BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
johnfrytz
Obsidian | Level 7

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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;
  1. Remote submit the first task.

  2. Sort the first data set as one task. Because WAIT=NO, both tasks are processed at the same time.

  3. Remote submit the second task.

  4. Sort the second data set as one task.

  5. Wait for both tasks to complete.

  6. Merge the results and continue processing.

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

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.

Jlochoa
Obsidian | Level 7
Right move click program to background submit

[cid:image001.png@01D61DB1.FA90F870]
SASKiwi
PROC Star

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;
  1. Remote submit the first task.

  2. Sort the first data set as one task. Because WAIT=NO, both tasks are processed at the same time.

  3. Remote submit the second task.

  4. Sort the second data set as one task.

  5. Wait for both tasks to complete.

  6. Merge the results and continue processing.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2342 views
  • 1 like
  • 3 in conversation