Ending OK and submitting table with ret code

All questions about Control-M jobs definitions
Post Reply
User avatar
Hubba
Nouveau
Nouveau
Posts: 69
Joined: 10 Dec 2007 12:00
Location: Boston

Ending OK and submitting table with ret code

Post by Hubba » 14 Jan 2010 6:04

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?

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 14 Jan 2010 7:23

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

Post Reply