22 %LOCAL logfile l_cmd rc filrf;
24 %LET logfile=%sysfunc(pathname(work))/___log.txt;
25 %let rc = %_delfile(&logfile);
26 %sysexec &i_cmd >
"&logfile";
28 %IF &g_verbose. %THEN %DO;
29 %PUT ======== OS Command Start ========;
31 %IF &sysrc. = 0 %then %put &g_note.(SASUNIT): Sysrc : 0 -> SYSEXEC SUCCESSFUL;
32 %ELSE %PUT &g_error.(SASUNIT): Sysrc : &sysrc -> An Error occured;
35 %PUT &g_note.(SASUNIT): SYSEXEC COMMAND IS: &i_cmd >
"&logfile";
41 %LET rc=%sysfunc(filename(filrf,&logfile));
42 %LET rc = %sysfunc(fexist(&filrf));
46 infile
"&logfile" truncover;
51 %ELSE %PUT No File Redirection
for Commands cd, pwd, setenv and umask;
52 %LET rc=%sysfunc(filename(filrf));
54 %PUT ======== OS Command End ========;