Reputation: 5538
I am reaching to SME on the subject after trying to figure out the solution of below scenario. I have a very specific requirement:
1) Say I have a schedule called SCH1, having 3 jobs JOB1, JOB2 and JOB3 like:
Schedule S1
JOB1
JOB2
FOLLOWS JOB1
JOB3
FOLLOWS JOB2
END
2) The JOB1 is calling a shell script. 3) Now if JOB1 shell script returns a code 0 – it is successful and execute JOB2 and JOB3. 4) If shell script returns code is anything other than 0, Still the JOB1 should not abend; but all other job JOB2 and JOB3 should be skipped (or completed without run); and schedule should be marked successful.
I got below link online, which suggest that this should be possible. But when I refer to syntax for Job/Schedule definition; I am not able to figure out that how it should be written.
In the job syntax, it looks like that below can do the trick, but not so sure.
[rccondsucc "Success Condition"]
[recovery
{stop | continue | rerun}
[after [workstation#]jobname]
[abendprompt “text”] ]
Conditional Dependency:
Job syntax:
Schedule syntax:
Upvotes: 1
Views: 4092
Reputation: 600
Since 9.3 FP1 this can be implemented with built-in conditional dependencies
Assuming you want JOB3 to wait if JOB2 abends, using conditional dependencies your scenario can be implemented like this
SCHEDULE SCH1
:
JOB1
DOCOMMAND "myscript"
STREAMLOGON twsuser
SUCCOUTPUTCOND GO "RC=0"
SUCCOUTPUTCOND NOGO "RC!=0"
JOB2
FOLLOWS JOB1 IF GO
JOB3
FOLLOWS JOB2
FOLLOWS JOB1 IF GO
END
JOB1 has 2 SUCCOUTPUTCOND
defined: GO if RC=0 and NOGO if RC!=0.
Both are SUCCOUTPUTCOND, meaning that JOB1 will go in SUCC in both cases.
FOLLOWS JOB1 IF GO
dependencies are satisfied, so JOB2 and JOB3 can be run (JOB3 will wait JOB2 since it has also a FOLLOWS JOB2
)FOLLOWS JOB1 IF GO
are not satisfied and JOB2 and JOB3 would be set to SUPPR
status and will not run.Upvotes: 0
Reputation: 1
To skip Job2 and Job3 with the help of Conditional dependencies Job1 must be in status "E". But you can add a Job4 to application that only runs if Job1 aborted (also defined with CondDep). This job completes Job1 (or whole application). It works - I demonstrated just this example on customer meeting :-)
It is also possible that Job1 completes and jobs Job2 and Job3 are skipped if these jobs have CondDep to Job1: Job1 must be in status "C" AND Job1 must end with RC<>0.
Upvotes: 0
Reputation: 51
I would say this is not possible.
With RCCONDSUCC you can fine tune the status of a job (SUCC or ABEND) depending on it's return code. This just means you are not limited to RC = 0 = SUCC or RC > 0 = ABEND.
With RECOVERY you can specify which action should be taken only when the JOB is in ABEND.
Here you want to force a JOB to SUCC and specify a RECOVERY....
Upvotes: 1