Page 1 of 1
hwo to stop an executing JCL
Posted:
Tue Jun 23, 2015 6:06 pm
by samb01
Hello,
i have a JCL with sereval steps :
step1
step2
step3
step4
etc..
until step 40.
I would like to stop the JCL without error if the step4 return a Return Code = 4
Is it possible without coding code condition in the others steps ?
Re: hwo to stop an executing JCL
Posted:
Tue Jun 23, 2015 9:34 pm
by NicC
Yes - use IF and put steps 5 to 40 after the IF.
Re: hwo to stop an executing JCL
Posted:
Thu Jun 25, 2015 2:03 pm
by samb01
Hello NicC,
thank's for your answer but we musn't use "if" in our Production JCL beaucause it's not so easy to rerun a abended job.
Re: hwo to stop an executing JCL
Posted:
Thu Jun 25, 2015 2:22 pm
by Blackthorn
So you want to do something, but don't want to use the tools that IBM provide you to accomplish it.....?
We have always found the ¬RUN keyword used with an IF statement to be a suitable way of coping with earlier steps not running due to a job restart.
Or if you have TWS you can use the supplied step restart function to take care of it for you. The JES control blocks will be manipulated for a restarted job so that return codes from the previous failed job are simulated when the job is rerun, thus allowing subsequent IF statements to be interpreted correctly. I daresay other schedulers have similar functionality.
Re: hwo to stop an executing JCL
Posted:
Thu Jun 25, 2015 2:53 pm
by BillyBoyo
If you're not allowed to use IF for some entirely spurious reason (the only thing difficult about re-run situations is if the JCL is coded badly to not expect re-runs) then have your scheduler control everything. If your site is suffering from the illusion that a 253-step JOB is the thing to do, then have each step as a separate JOB.
Re: hwo to stop an executing JCL
Posted:
Thu Jun 25, 2015 3:06 pm
by NicC
If this is production then your job is WRONG. Steps 5 onwards should be a separate job which is dependent on the success, or otherwise, of the first four steps.