Hi All.,
I am using SAS on Linux platform. I do not have SAS Connect or any other SAS Upgrades(Have basic SAS license).
I am having a situation., while running a SAS Program which spawns out 20 parallel jobs. Each of those parallel jobs have their own run times. Outputs from those parallel jobs should be appended at the end.
I have two solutions:
1) Create a new SAS program and append all the datasets in this program separately (Not efficient for a simple task of appending)
OR
2) Ask SAS to "WAIT" until all the parallel jobs are completed and then append in the same program. But the catch here is, we do not know when the parallel jobs would be completed.
So how would we tell SAS to WAIT until all the parallel jobs are completed?
Thanks,
Prad
Write a shell scripts that runs all SAS subjobs in the background and waits for them with the wait command. When you run this script from the main SAS program, the termination of the script will mean that all subjobs have finished.
Hi,
If you are using the SYSTASK (https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/p0lzxl2mwndagun1dtxbst9s4jea.htm) statement to invoke parallel session each session gets can get its unique ID and you can ask SAS to wait for all listed IDs.
Here is my micro-tutorial of how to work with systask:
https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/Parallel-processing-in-BASE-SAS.sas
Bart
A relatively new solution to this problem would be sasjs/server - this provides a REST API over Foundation SAS, and would let you spawn jobs using any third party programming language (or, of course, SAS)
Disclaimer - my team built this tool, and there are still some upgrades needed on the security side (as of 22nd Jan 2022) to make it suitable for server (as opposed to desktop) use. You can track progress in the github (security issues will be resolved from v1) or engage our team here: https://sasapps.io
Here's a video of building a react app with sasjs/server, sasjs/adapter, sasjs/cli, and sasjs/core:
https://www.youtube.com/watch?v=F23j0R2RxSA
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!
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.