ATTENTION : Ce contenu est DÉSACTIVÉ. Il est invisible pour les visiteurs.
Difficulty Level
Beginner
Published on :
The `initlilly_setup` macro is designed to configure a standardized working environment. It takes three parameters: `phase2` (default 'qa'), `ref` (default 'TDTM'), and `PorV` (default 'programs_stat'). It detects the operating system (`%sysscp`) to adjust the path separator (`sep`) and the path definition logic. For Windows, it breaks down the `pathroot` macro variable into different segments (drive root, root directory, development phase, compound, study, analysis phase) and uses these segments to construct paths for the `arcmeta`, `rptlib`, `sdtm`, and `adam` libraries. It also includes an external formatting file. For Unix, it assumes that path macro variables (`arcmeta`, `rptlib`, `rptlibv`, `dev_path`, `val_path`, `bum_path`, `format_intrm1`) are already defined outside the macro and uses them to define libraries and include the formatting file. Finally, it defines a global `studyid` variable based on the compound name.
Data Analysis
Type : EXTERNE
The macro does not directly manipulate data, but it establishes the necessary connections to external data sources. SAS libraries (`arcmeta`, `rptlib`, `sdtm`, `adam`) are defined to point to file system directories where project data (SDTM, ADAM) and metadata (arcmeta) are stored. The path to these directories is constructed dynamically from the `pathroot` variable (for Windows) or is assumed to be predefined (for Unix).
1 Code Block
Macro Definition
Explanation : This block defines the `initlilly_setup` macro. It initializes global macro variables (`os`, `sep`, `drive_root`, etc.) which are used to construct file and directory paths for the project. The conditional logic (`%if %upcase(&sysscp) = WIN %then ... %else`) allows adapting paths and file separators based on the operating system. `libname` statements are used to associate SAS library names with physical paths, thus facilitating access to metadata (`arcmeta`), report outputs (`rptlib`), and standardized clinical datasets (`sdtm`, `adam`). For Windows, paths are dynamically constructed from a `pathroot` variable and macro parameters. For Unix, the macro assumes that full paths are already passed via macro variables. Finally, an external formatting file is included (`%include`) to apply specific formats to the data. The `studyid` variable is also defined.
Copied!
%macro initlilly_setup(phase2=qa,ref=TDTM,PorV=programs_stat);
%initlilly;
%global os sep drive_root dir_root dev_phase dev_phase2 compound study analy_phase referenc pgm_dir
studyid trt1 trt2 trt3 trt4 trt5;
%if %upcase(&sysscp) = WIN %then
%do;
%let os = %lowcase(&sysscp);
%let sep=\\; /* Note: backslash escaped for JSON output */
/*Set up directory macro variables and the libraries*/
%let drive_root=%scan(&pathroot,1,&sep); /*Drive*/
%let dir_root=%scan(&pathroot,2,&sep); /*root directory*/
%let dev_phase=%scan(&pathroot,3,&sep);/*development phase before DBL*/
%let dev_phase2=&phase2;/*development phase after DBL*/
%let compound=%scan(&pathroot,4,&sep); /*compound name*/
%let study=%scan(&pathroot,5,&sep); /*study name*/
%let analy_phase=%scan(&pathroot,6,&sep); /*need to change when starting another interim lock*/
%let referenc=&ref; /*need to change after prd data is ready*/
%let pgm_dir=&porv;/*program location*/
libname arcmeta "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\data\shared\arc_reporting_metadata"; /*location of arc tool metadata*/
libname rptlib "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\&pgm_dir\tfl_output"; /*location of outputs*/
libname sdtm "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\data\shared\sdtm" access=readonly;
libname adam "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\data\shared\adam" access=readonly;
/*options errorcheck=strict serror mprint mlogic mlogicnest symbolgen notes source nosource2 nocenter nodate nonumber fmtsearch=(work);*/
/*Include output formatting*/
%include "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\programs_stat\format_hhbh.sas";
%end;
%else
%do;
%let os = unix;
%let sep=%str(/);
libname arcmeta "&arcmeta"; /*location of arc tool metadata*/
libname rptlib "&rptlib"; /*location of outputs*/
libname rptlibv "&rptlibv"; /*location of independent programming outputs*/
/*Set up the study programming environment*/
options sasautos=("&dev_path" "&val_path" "&bum_path" sasautos) mautosource;
/*options errorcheck=strict serror mprint mlogic mlogicnest symbolgen notes source nosource2 nocenter nodate nonumber fmtsearch=(work);*/
/*Include output formatting*/
%include &format_intrm1;
%end;
%let studyid=%upcase(&compound);
%mend;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Related Documentation
Aucune documentation spécifique pour cette catégorie.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.