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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.