For what I know, you can submit a background job by right-clicking the program in the navigation pane and select Background submit.
My question us, does anyone know or have tried doing it programmatically.
For example, if the value of parameter set is between :
1 - 300 then execute 1 background job.
301 - 600 then execute 2 background job.
601 - 900 then execute 3 background job.
.... and so on
depending on the maximum allowed background job of the user.
Cheers.
Here is an example using SAS/CONNECT from the SAS documentation: https://documentation.sas.com/?docsetId=connref&docsetTarget=n11s7t6mbyae21n1byrkhyhofcqd.htm&docset...
signon remote1 sascmd="!sascmd -nosyntaxcheck -noterminal";
signon remote2 sascmd="!sascmd -nosyntaxcheck -noterminal";
rsubmit remote1 wait=no; 1
libname mydata '/project/test1';
proc sort data=mydata.part1; 2
by x;
run;
endrsubmit;
rsubmit remote2 wait=no; 3
libname mydata '/project/test2';
proc sort data=mydata.part2; 4
by x;
run;
endrsubmit;
waitfor _all_ remote1 remote2; 5
libname mydata ('/project/test1' '/project/test2'); 6
data work.sorted;
merge mydata.part1 mydata.part2;
run;
Remote submit the first task.
Sort the first data set as one task. Because WAIT=NO, both tasks are processed at the same time.
Remote submit the second task.
Sort the second data set as one task.
Wait for both tasks to complete.
Merge the results and continue processing.
Yes, you can. The easiest way to do this is using SAS/CONNECT. If you don't have this product then it is harder and you need to have the ability to run operating system commands from SAS - XCMD SAS option - to run SAS batch jobs.
Here is an example using SAS/CONNECT from the SAS documentation: https://documentation.sas.com/?docsetId=connref&docsetTarget=n11s7t6mbyae21n1byrkhyhofcqd.htm&docset...
signon remote1 sascmd="!sascmd -nosyntaxcheck -noterminal";
signon remote2 sascmd="!sascmd -nosyntaxcheck -noterminal";
rsubmit remote1 wait=no; 1
libname mydata '/project/test1';
proc sort data=mydata.part1; 2
by x;
run;
endrsubmit;
rsubmit remote2 wait=no; 3
libname mydata '/project/test2';
proc sort data=mydata.part2; 4
by x;
run;
endrsubmit;
waitfor _all_ remote1 remote2; 5
libname mydata ('/project/test1' '/project/test2'); 6
data work.sorted;
merge mydata.part1 mydata.part2;
run;
Remote submit the first task.
Sort the first data set as one task. Because WAIT=NO, both tasks are processed at the same time.
Remote submit the second task.
Sort the second data set as one task.
Wait for both tasks to complete.
Merge the results and continue processing.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.