I want to run the following a.sas and b.sas in a sequential way.
data a;
a=1;
run;
proc export file="!userprofile\desktop\a.csv";
run;data b;
b=1;
run;
proc export file="!userprofile\desktop\b.csv";
run;I wrote a batch file ab.bat to run them and found that this batch opens the second parallel SAS session before finishing the first one.
"%programfiles%\sashome\sasfoundation\9.4\sas" %userprofile%\desktop\a.sas -nolog "%programfiles%\sashome\sasfoundation\9.4\sas" %userprofile%\desktop\b.sas -nolog
Unlike this MWE, my SAS files are dependent. How can I run the two SAS files non-simultaneously?
If you don't want to put all of the code in a single file you can use a single program to include the program files. Basically a single program file that looks like the following (where path is appropriate for your operating system). The path is generally best if starting at a drive or disk mount and not a relative path.
%include "<path>\a.sas";
%include "<path>\b.sas";
If you don't want to put all of the code in a single file you can use a single program to include the program files. Basically a single program file that looks like the following (where path is appropriate for your operating system). The path is generally best if starting at a drive or disk mount and not a relative path.
%include "<path>\a.sas";
%include "<path>\b.sas";
Thanks, but I wondered if I can do this with batch files due to this reason—to avoid possible interference.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.