Autosys - Jobs are running parallel when not running condition exists

5.6k Views Asked by At

I have five box jobs a,b,c,d,e. Each box job has a starting condition below.

For job a, the condition is: n(b) and n(c) and n(d) and n(e)

For job b, the condition is: n(a) and n(c) and n(d) and n(e)

For job c, the condition is: n(b) and n(a) and n(d) and n(e)

Similarly for other 2 jobs. (n=not running), These jobs will trigger around 10 minutes apart for every 1 hour. Job "a" starts at 9:00 AM, Job "b" starts at 9:10 AM, Job "c" starts at 9:20 AM and so on.

As per above condition when job "a" running b,c,d,e shouldn't run. But in real time what I am finding is, they are running in parallel. following is the example.

Lets assume job "a" started at 9:00 AM and completed at 9:30 AM, Mean time job "b","c","d" starts as per its schedule at 9:10 AM,9:20 AM & 9:30 AM respectively and waiting for Job "a" to complete. As soon as job "a" complete at 9:30 AM, all jobs "b","c" & "d" starting in parallel since at 9:30 AM (probably for fraction of seconds) no jobs are running so conditions for b,c & d jobs are satisfying and triggering the jobs.

Can some one help me with a solution for above issue.

2

There are 2 best solutions below

1
On

I suggest you can define a resource with single quantity and use the resource in all the 5 jobs. You can even avoid using different start times. This will allow only one job to start at a time.

1
On

You can create a box job to include the box jobs b, c and d, including them after one another in the job flow so that the next job cannot run until the previous one has run successfully, ie job c won't run until job b is successful.

Please read: Can I create One Box Job inside another box job in Autosys by JIL where including a box job within a box job is explained

If you do not want them to be reliant on each other then using delayed start times after each job will work, but may not overcome the problem if on an occasion a job takes longer to run and proceeds to run in parallel with one of the other box jobs.