hwo to stop an executing JCL



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

hwo to stop an executing JCL

Postby samb01 » Tue Jun 23, 2015 6:06 pm

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 ?
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: hwo to stop an executing JCL

Postby NicC » Tue Jun 23, 2015 9:34 pm

Yes - use IF and put steps 5 to 40 after the IF.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: hwo to stop an executing JCL

Postby samb01 » Thu Jun 25, 2015 2:03 pm

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.
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: hwo to stop an executing JCL

Postby Blackthorn » Thu Jun 25, 2015 2:22 pm

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.
Blackthorn
 
Posts: 130
Joined: Tue Feb 01, 2011 7:12 pm
Has thanked: 1 time
Been thanked: 9 times

Re: hwo to stop an executing JCL

Postby BillyBoyo » Thu Jun 25, 2015 2:53 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: hwo to stop an executing JCL

Postby NicC » Thu Jun 25, 2015 3:06 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post