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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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