Project Environment Initialization

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!
1%macro initlilly_setup(phase2=qa,ref=TDTM,PorV=programs_stat);
2%initlilly;
3%global os sep drive_root dir_root dev_phase dev_phase2 compound study analy_phase referenc pgm_dir
4 studyid trt1 trt2 trt3 trt4 trt5;
5%IF %upcase(&sysscp) = WIN %THEN
6 %DO;
7 %let os = %lowcase(&sysscp);
8 %let sep=\\; /* Note: backslash escaped for JSON output */
9 /*Set up directory macro variables and the libraries*/
10 %let drive_root=%scan(&pathroot,1,&sep); /*Drive*/
11 %let dir_root=%scan(&pathroot,2,&sep); /*root directory*/
12 %let dev_phase=%scan(&pathroot,3,&sep);/*development phase before DBL*/
13 %let dev_phase2=&phase2;/*development phase after DBL*/
14 %let compound=%scan(&pathroot,4,&sep); /*compound name*/
15 %let study=%scan(&pathroot,5,&sep); /*study name*/
16 %let analy_phase=%scan(&pathroot,6,&sep); /*need to change when starting another interim lock*/
17 %let referenc=&ref; /*need to change after prd data is ready*/
18 %let pgm_dir=&porv;/*program location*/
19 
20 LIBNAME arcmeta "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\data\shared\arc_reporting_metadata"; /*location of arc tool metadata*/
21 LIBNAME rptlib "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\&pgm_dir\tfl_output"; /*location of outputs*/
22 LIBNAME sdtm "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\data\shared\sdtm" access=readonly;
23 LIBNAME adam "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\data\shared\adam" access=readonly;
24 
25 /*options errorcheck=strict serror mprint mlogic mlogicnest symbolgen notes source nosource2 nocenter nodate nonumber fmtsearch=(work);*/
26 
27 /*Include output formatting*/
28 %include "&drive_root\&dir_root\&dev_phase\&compound\&study\&analy_phase\programs_stat\format_hhbh.sas";
29 %END;
30%ELSE
31 %DO;
32 %let os = unix;
33 %let sep=%str(/);
34 
35LIBNAME arcmeta "&arcmeta"; /*location of arc tool metadata*/
36LIBNAME rptlib "&rptlib"; /*location of outputs*/
37LIBNAME rptlibv "&rptlibv"; /*location of independent programming outputs*/
38 
39/*Set up the study programming environment*/
40options sasautos=("&dev_path" "&val_path" "&bum_path" sasautos) mautosource;
41/*options errorcheck=strict serror mprint mlogic mlogicnest symbolgen notes source nosource2 nocenter nodate nonumber fmtsearch=(work);*/
42 
43/*Include output formatting*/
44%include &format_intrm1;
45%END;
46%let studyid=%upcase(&compound);
47 
48 
49%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.