Flush all steps of a JCL based on return code from one step



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

Flush all steps of a JCL based on return code from one step

Postby ashokkumar_rn » Thu Apr 25, 2013 3:09 pm

Hi,

I have a JCL with 40 steps.

My requirement is if the return code from STEP-14 is 04, then I have to execute the last step of the job and exit.
This is a cyclic job that runs once every 15 mins.

04 is an acceptable return code for this job.

Can you please help me know how this can be done?

Regards,
Ashok
ashokkumar_rn
 
Posts: 12
Joined: Wed Mar 27, 2013 7:59 pm
Has thanked: 8 times
Been thanked: 0 time

Re: Flush all steps of a JCL based on return code from one s

Postby Akatsukami » Thu Apr 25, 2013 3:19 pm

The title of this thread seems incompatible with the opening post. If the completion code of STEP14 is not four, what should be done? (This may be more than one thing.)
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Flush all steps of a JCL based on return code from one s

Postby ashokkumar_rn » Thu Apr 25, 2013 3:22 pm

If the return code from step14 is not four then all the steps should execute.

If its equal to 4 then execute only the last step of the job.
ashokkumar_rn
 
Posts: 12
Joined: Wed Mar 27, 2013 7:59 pm
Has thanked: 8 times
Been thanked: 0 time

Re: Flush all steps of a JCL based on return code from one s

Postby enrico-sorichetti » Thu Apr 25, 2013 3:30 pm

why not look at the manuals Yourself
JCL guide,
JCL reference

and meditate on the use of the COND <keyword>
and on the use of the IF/THEN/ELSE construct

???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Flush all steps of a JCL based on return code from one s

Postby Akatsukami » Thu Apr 25, 2013 3:30 pm

ashokkumar_rn wrote:If the return code from step14 is not four then all the steps should execute.

If its equal to 4 then execute only the last step of the job.

Then you'll want something like this:
//STEP01   EXEC PGM=P1
    :
//STEP14   EXEC PGM=P14
//IF1      IF   (STEP14.RC ¬= 4) THEN
//STEP15   EXEC PGM=P15
    :
//STEP39   EXEC PGM=P39
//ENDIF1   ENDIF
//STEP40   EXEC PGM=P40
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day

These users thanked the author Akatsukami for the post:
ashokkumar_rn (Thu Apr 25, 2013 9:23 pm)
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Flush all steps of a JCL based on return code from one s

Postby ashokkumar_rn » Fri Apr 26, 2013 12:41 pm

Thanks to both of you for the help. This is working as expected.
ashokkumar_rn
 
Posts: 12
Joined: Wed Mar 27, 2013 7:59 pm
Has thanked: 8 times
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post