BookmarkSubscribeRSS Feed
prad001
Obsidian | Level 7

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

4 REPLIES 4
Reeza
Super User
How are you spawning your 20 parallel jobs?
Kurt_Bremser
Super User

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.

yabwon
Onyx | Level 15

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

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



AllanBowe
Barite | Level 11

 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

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1335 views
  • 6 likes
  • 5 in conversation