DATA Step, Macro, Functions and more


Occasional Contributor
Posts: 8


I have a program that calls a number of other macro programs in sequential order.

However some of the programs are not dependent on the previous completing.

Let's say macros 1,2,3,4,5 need to run sequentially and are dependent on the previous macro(s) executing to completion.

There is also macros A,B,C,D,E that do not have to wait until the previous macros complete.

Let's also assume the 1,2,3,4,5 need to complete before A,B,C,D,E are submitted.

Does anyone know if or how I could multi-thread and submit A,B,C,D,E to all run at the same time and have them run independently.

Super Contributor
Super Contributor
Posts: 3,176

Re: Multi-Threading

I might consider it be called job/task-scheduling. You can spawn independent SAS tasks in your SAS operating environment.

And without a scheduling subsystem, you can write logic to "sleep" and "awaken" to test for some crumbs/morsels that are left by a predecessor job/process.

And, SAS jobs can be executed in sequence using various techniques, such as parent/child process/task execution or sequential threading (A completes, then submits B, C, D, and waits for B and C before submitting E - waits for D and E, then submits F).

Sure it's possible. Recommend reviewing the particular SAS companion guide for your OS, with focus on the OS system interfaces, such as CALL EXECUTE, CALL SYSTEM, and FILENAME PIPES engine, to start.

Scott Barry
SBBWorks, Inc.

Recommended Google advanced search argument for this topic/post:

batch program scheduling
Super User
Posts: 5,884

Re: Multi-Threading

You might also consider the technique called MP CONNECT, see on-line doc for details.

Data never sleeps
Super Contributor
Posts: 474

Re: Multi-Threading


Either leave it to the system/scheduler
if your site has SAS/CONNECT licensed then MP CONNECT gives you the ability to submit asynchronous remote/local processes.

Cheers from Portugal.

Daniel Santos @
Not applicable
Posts: 0

Re: Multi-Threading

Posted in reply to DanielSantos
Thanks to all.

Respected Advisor
Posts: 3,852

Re: Multi-Threading

Posted in reply to deleted_user
I believe all these features you desire are provided for with the SAS statements SYSTASK and WAITFOR.
Ask a Question
Discussion stats
  • 5 replies
  • 6 in conversation