Desktop productivity for business analysts and programmers

SAS job across multiple machine

Reply
Super Contributor
Super Contributor
Posts: 404

SAS job across multiple machine

Hello - we have SAS 9.4 running on Linux as grid environment.

 

If I have multiple sas programs (test1.sas/test2.sas/test3.sas) that I want to run across multiple sas nodes (not just on one node) - what is best way to do that and what are the requirements from sas architecture or configuration stand point that I must have it in place?

 

please suggest - thanks.

Super User
Posts: 5,829

Re: SAS job across multiple machine

It's not clear how and why you want to execute one program on several nodes. Please elaborate.
There are three typical use cases for grid (perhaps even more):
- many user can share an environmnet that easily can scale up (and down)
- jobs that parallel logic can run those in separate grid sessions
- divide an conquer large data set processing

Have you read through the grid documentation and searched the web for examples?
Data never sleeps
Super Contributor
Super Contributor
Posts: 404

Re: SAS job across multiple machine

I can put my different sas programs into one as a piece of codes, but i still wants to run those pieces of codes across sas worker nodes/servers (not only on one server) so that they can run in parallel as well. 

 

 

Super Contributor
Super Contributor
Posts: 404

Re: SAS job across multiple machine

So, if I run Unix script (test.sh) which has 3 sas program, all jobs runs on same sas node, I want to distribute across multiple nodes. Thanks.

 

sas "/codedir/test1.sas" -log "/logdir/test1.log" -set run 1
sas "/codedir/test1.sas" -log "/logdir/test2.log" -set run 2
sas "/codedir/test1.sas" -log "/logdir/test3.log" -set run 3

Super Contributor
Posts: 292

Re: SAS job across multiple machine

Submit your batch jobs using the SASGSUB command. This will distribute your jobs across the Grid according the policies you've set up.

 

http://support.sas.com/documentation/cdl/en/gridref/67371/HTML/default/viewer.htm#p1vejjepgd6q6nn1mw...

 

Super Contributor
Super Contributor
Posts: 404

Re: SAS job across multiple machine

Thanks . So if I put all my three program into one sas job like below,

 

test.sas has,

%macro test;

%include /user-home-dir/test1.sas

%include /user-home-dir/test2.sas

%include /user-home-dir/test3.sas

%mend;

%test;

 

and if I submit using command -> sasgsub -gridsubmitpgm /user-home-dir/test.sas 

this is still running on same node.

 

any additional parameters or settings required?  

 

 

Super User
Posts: 5,829

Re: SAS job across multiple machine

If you already have your programs separate, why do you want to put them together?
Obviously this will make it harder to split them up again to have them executed in parallel.
Data never sleeps
Super Contributor
Posts: 292

Re: SAS job across multiple machine

@LinusH is correct, it doesn't really make sense.

 

For splitting up SAS code, there are really three main scenarios:

 

1.) You have x number of SAS jobs that you can run in parallel e.g. my_job_1.sas, my_job_2.sas, my_job_3.sas. For this example I suggested the SASGSUB command since you can submit the three jobs to the Grid to run independently.

2.) You have a single SAS job e.g. my_job_1.sas, but WITHIN the job there are pieces of the code that you can run in parallel. This probably speaks more to your last example. In this case you would invoke grdsrv_enable(_all_,resource=SASApp) macro that will allow the pieces of SAS cdoe to be submitted to the Grid using SAS/Connect (rsubmit).

3.) A combination of 1.) and 2.)

 

Bottom line is, you have many tools in the Grid toolbox, but it really comes down to the design of the code and what you trying to achieve in terms of parallel processing/load management. This is your logical design. Once you have this defined , then it's easy to see what Grid tool you need. So it's not about 'Do I use 1, 2, or 3 ?' It's about what you are trying to achieve.

 

Hope it helps.....

 

Ask a Question
Discussion stats
  • 7 replies
  • 217 views
  • 0 likes
  • 3 in conversation