SASUnit Examples  Version 1.5.0
linux/_mkdir.sas
Go to the documentation of this file.
1 
23 %macro _mkdir (dir
24  );
25  %LOCAL logfile;
26 
27  %let logfile=%sysfunc(pathname(work))/___log.txt;
28 
29  %SYSEXEC(mkdir "&dir." > "&logfile" 2>&1);
30  %if &g_verbose. %then %do;
31  %put ======== OS Command Start ========;
32 
33  /* Evaluate sysexec´s return code */
34  %if &sysrc. = 0 %then %put &g_note.(SASUNIT): Sysrc : 0 -> SYSEXEC SUCCESSFUL;
35  %else %put &g_error.(SASUNIT): Sysrc : &sysrc -> An Error occured;
36 
37  /* put sysexec command to log*/
38  %put &g_note.(SASUNIT): SYSEXEC COMMAND IS: mkdir "&dir." > "&logfile" 2>&1;
39 
40  /* write &logfile to the log*/
41  data _null_;
42  infile "&logfile" truncover lrecl=512;
43  input line $512.;
44  putlog line;
45  run;
46  %put ======== OS Command End ========;
47  %end;
48 
49 %mend _mkdir;
50