When start a new clinical study, the first step is to bulid the folders for programmer users.
you can click the mouse to create the folder and set the folder properties on your PC.
How to set the folder properties through programming under the system of MS windows, and only the owner can change and update his or her own code, others have no right to do.
*******************************************
How to set the folder properties in the code under the system of MS windows
When start a new clinical study, the first step is to bulid the folders for programmer users.
you can click the mouse to create the folder and set the folder properties on your PC, but how to use the code to do those things automatically?
******************************************;
%MACRO SETUP;
%let Sponsor=COMPANY001;
%let Study=STUDY001;
%let root=D:\&Sponsor\&study;
%let PHASE=DRAFT;
%LET QCUSER=TOM;
/*-----------------------------------------------------------------------------
Create folder and Libnames
----------------------------------------------------------------------------*/
options noxwait;
x mkdir "&root\";
x mkdir "&root\0_DOC";
x mkdir "&root\&PHASE";
x mkdir "&root\&PHASE\0_DOC";
x mkdir "&root\&PHASE\PROD";
x mkdir "&root\&PHASE\PROD\ADAM";
x mkdir "&root\&PHASE\PROD\SDTM";
x mkdir "&root\&PHASE\PROD\RAW";
x mkdir "&root\&PHASE\QC";
%if %upcase(&QCUSER) ne %then %do;
x mkdir "&root\&PHASE\QC\&QCUSER\ADaM\";
x mkdir "&root\&PHASE\QC\&QCUSER\Programs\";
x mkdir "&root\&PHASE\QC\&QCUSER\Macros\";
x mkdir "&root\&PHASE\QC\&QCUSER\Output\";
/* How to set the folder properties through programming under the system of MS windows
1.only the owner can change and update his or her own code, others have no right to do*/
libname ADaM "&root\&PHASE\QC\&QCUSER\ADaM\";
libname SDTM "&root\&PHASE\QC\&QCUSER\SDTM\";
libname RAW "&root\&PHASE\QC\&QCUSER\RAW\";
libname Output "&root\&PHASE\QC\&QCUSER\Output\";
%end;
options xwait;
%MEND;
%setup;
A quick Google search that there is a utility in Windows (Server) called icacls that does this.
The X statement (and other SAS means) executes a system command (like mkdir).
icacls is just another system command, so you execute it the same way.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.