DATA Step, Macro, Functions and more

Multi-Threading

Reply
Occasional Contributor
Posts: 8

Multi-Threading

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.

Thanx.
_AW_
Super Contributor
Super Contributor
Posts: 3,174

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 site:sas.com
Super User
Posts: 5,435

Re: Multi-Threading

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

/Linus
Data never sleeps
Super Contributor
Posts: 474

Re: Multi-Threading

Yep,

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

http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/a002626619.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
N/A
Posts: 0

Re: Multi-Threading

Posted in reply to DanielSantos
Thanks to all.

_AW_
Respected Advisor
Posts: 3,799

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
  • 145 views
  • 0 likes
  • 6 in conversation