DATA Step, Macro, Functions and more

Trigger SAS Jobs from a SAS Dataset

Reply
Occasional Contributor
Posts: 15

Trigger SAS Jobs from a SAS Dataset

[ Edited ]
Hi. I have a Dynamic SAS dataset with job names and its corresponding dependencies. The dependencies might be waiting for other jobs as well. Could you please advise 
Exsmple below: Let me know any queries,
Main Table contains:

MasterJobName Dependencies
ABC DEF
GHI

DEF KJL


Log Table:

Jobname Status
ABC P
DEF F
GHI P
KJL P


ABC can be triggered only when DEF and GHI are completed
successfully, but DEF can be triggerd only when KJL is completed successfully.
Also when a job is failed, other jobs which are not dependent should keep executing
WHen a job is completed, status is updated in log table.
how to trigger the jobs from this table in SAS?

Thanks,
Super User
Super User
Posts: 7,970

Re: Trigger SAS Jobs from a SAS Dataset

What software are you using?  For this type of task using Enterprise Guide and setting up flows would likely be the way to go.  

Occasional Contributor
Posts: 15

Re: Trigger SAS Jobs from a SAS Dataset

Hi.

 

I am using SAS EG . But actually, what we use is controlm scheduler for the dependencies and triggering  . There are controlm jobs for each and there are around 5000 SAS Jobs. To reduce the controlm jobs, now the reqmnt is to maintain all dependencies in a  table and trigger the jobs, 

Occasional Contributor
Posts: 15

Re: Trigger SAS Jobs from a SAS Dataset

A SAS code has to be written for this. I am not sure how we wil know if a child job is completed successfully, i mean we can check the log, but how long to wait before triggering the master job . 

Super User
Posts: 7,809

Re: Trigger SAS Jobs from a SAS Dataset

Control-M is an enterprise scheduler. 5000 jobs is almost nothing to it. Don't start reinventing the wheel when you've already got the perfect tool.

If you want to reduce the number of jobs, look for SAS programs that can be combined into one.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 15

Re: Trigger SAS Jobs from a SAS Dataset

Posted in reply to KurtBremser
Hi. To avoid many controlm jobs this is a new requirement,
Super User
Posts: 7,809

Re: Trigger SAS Jobs from a SAS Dataset


Sandy10 wrote:
Hi. To avoid many controlm jobs this is a new requirement,

Idiocy. It's only getting worse when you start mixing environments.

It only makes sense where you have a bunch of SAS jobs that can easily(!) be combined into one, and where the intermediate results are not important (eg for other jobs). As soon as you get more-than-plain-simple job logic, STAY WITH CONTROL-M.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 119

Re: Trigger SAS Jobs from a SAS Dataset

Look at the systask and waitfor commands. Here is a link under 9.2 (has not changed as far as I know):

 

https://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#win-stmt-waitfor....

 

 

Occasional Contributor
Posts: 15

Re: Trigger SAS Jobs from a SAS Dataset

This seems to be a windows command. We are using Linux .
Occasional Contributor
Posts: 15

Re: Trigger SAS Jobs from a SAS Dataset

Hi All. Thanks for replies .My main doubt is if a job(JobA)  is dependent on  job(JobB) which in turn is dependent on another job(JobC),  how will i know if Job C is completed . How long to wait for a job to be completed to proceed to another job ? Thanks,

Ask a Question
Discussion stats
  • 9 replies
  • 64 views
  • 0 likes
  • 4 in conversation