What I have is a daily job and 15 daily successor jobs. If the first job gets a non zero return code(no input data) I want the job to end successfully and delete the 15 successor jobs from the days schedule.
If the job does get a zero return code, then I would like to run the 15 jobs.
What would be the easiest way to do this? I could put the 15 jobs in a table and submit them if the job ends not-ok but how do I have the job end not-ok and ok at the same time?
Ending OK and submitting table with ret code
- nicolas_mulot
- Nouveau
- Posts: 149
- Joined: 07 Jan 2010 12:00
Hubba,
Its not so easy to automate the removal of jobs that have been already ordered.
The most direct reply to your need is, as you suggest yourself, to order the successors when needed.
ON STMT * CODE COMPSTAT != 0
DO OK
ON STMT * CODE COMPSTAT = 0
DO FORCEJOB TABLE <TABLE> JOBNAME <JOBNAME>
You can either define all jobs in the same sched table, and specify 14 explicit DO FORCEJOB or define your 14 successors in an extra table, and specify a single DOFORCEJOB against that table, leaving a blan JOBNAME
In the first case, the 14 successors should have empty scheduling parameters, let'say Days "None", WeekDays "None", Months "None".
Still, the inconvenient of this solution is that your 14 successors will not appear in the forecasts (EM Forecast, ctmrpln) as orderable for
any day, while the normal situation (RC=0 on the pred) is that these 14 jobs should be ordered and executed.
Why do your insist on deleting the successors? Isn't it enough for them not to execute in case pred returns a nonzero return code ?
In this case, forget the OUT conditions, order all your 15 jobs daily, and code something like:
ON STMT * CODE COMPSTAT != 0
DO OK
ON STMT * CODE COMPSTAT = 0
DO COND RUN_14_SUCC ODAT +
And dont forget to specify Tools --> Options --> Links --> Display Do Conditions (as dotted links)
Cheers
Nicolas_Mulot
Its not so easy to automate the removal of jobs that have been already ordered.
The most direct reply to your need is, as you suggest yourself, to order the successors when needed.
ON STMT * CODE COMPSTAT != 0
DO OK
ON STMT * CODE COMPSTAT = 0
DO FORCEJOB TABLE <TABLE> JOBNAME <JOBNAME>
You can either define all jobs in the same sched table, and specify 14 explicit DO FORCEJOB or define your 14 successors in an extra table, and specify a single DOFORCEJOB against that table, leaving a blan JOBNAME
In the first case, the 14 successors should have empty scheduling parameters, let'say Days "None", WeekDays "None", Months "None".
Still, the inconvenient of this solution is that your 14 successors will not appear in the forecasts (EM Forecast, ctmrpln) as orderable for
any day, while the normal situation (RC=0 on the pred) is that these 14 jobs should be ordered and executed.
Why do your insist on deleting the successors? Isn't it enough for them not to execute in case pred returns a nonzero return code ?
In this case, forget the OUT conditions, order all your 15 jobs daily, and code something like:
ON STMT * CODE COMPSTAT != 0
DO OK
ON STMT * CODE COMPSTAT = 0
DO COND RUN_14_SUCC ODAT +
And dont forget to specify Tools --> Options --> Links --> Display Do Conditions (as dotted links)
Cheers
Nicolas_Mulot