Wednesday, March 20, 2013

SAS: Running DOS commands or programs from SAS

Running SAS commands or programs from SAS.  Remember: use X command for DOS (builtin) commands, and SYSTASK for DOS programs!

options NOXWAIT;  * Close window when done.  Do not wait for me to type "exit". ;
x "del &NOAA_FOLDER.all.dat";
systask command "start /wait &PATH_TO_7ZIP_EXE x &FOLDER.&YEAR..tar -o&TEMP -aoa" wait;
systask command "start /wait &PATH_TO_7ZIP_EXE x &TEMP\*.gz -o&TEMP -aoa" wait;
x "copy &TEMP\*.op &FOLDER.all.dat /y";  * concatenate into a single file ;
x "del &TEMP\*.* /q";



No comments:

Post a Comment