BookmarkSubscribeRSS Feed
blueskyxyz
Lapis Lazuli | Level 10

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.

Capture.PNG

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;

 

4 REPLIES 4
blueskyxyz
Lapis Lazuli | Level 10
Thanks @Kurt_Bremser
the cmd command is a good option, is there any X command in sas code to grant the read and exectute access?

In excel, the user can record the simple VBA macro code when click the icon of record macro, do you know any software can record the cmd command to create batch file quickly?
blueskyxyz
Lapis Lazuli | Level 10
@ KurtBremser, appreciate your reply & suggestion, I'll try to optimize my code

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1036 views
  • 0 likes
  • 2 in conversation