Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Stoping JOB steps based on Return Code.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rpchandar

New User


Joined: 02 Sep 2005
Posts: 6

PostPosted: Thu Oct 20, 2005 11:23 am    Post subject: Stoping JOB steps based on Return Code.
Reply with quote

Hi,

I have a JCL, which has 15 Steps. Based on the return Code of step 5, I want to execute the remaining steps. If the the return code of step-5 is greater than 8, the remaining steps should not execute and the job should end. One way is to check for condition code from step 6 to step 15. Is there any other way?
Back to top
View user's profile Send private message

MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Oct 20, 2005 2:05 pm    Post subject:
Reply with quote

This question is already discussed, make a search before posting.

Yes, of course but you must be sure that the same return code does not appair in the previous steps.
If you code your jobcard with COND=(8,EQ) your job will end if this condition is satisfied but only the first time.
This is a sample:
Code:
//$MYJOB   JOB 'accn',CLASS=X,COND=(8,EQ)
//STEP010I EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=B     
//SYSIN    DD *           
   SET MAXCC=1               
//STEP020I EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=B     
//SYSIN    DD *           
   SET MAXCC=8               
//STEP030I EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=B     
//SYSIN    DD *           
   SET MAXCC=1               

and, in this case, the job is stopped after the STEP020I.

I hope in this help.
Back to top
View user's profile Send private message
rpchandar

New User


Joined: 02 Sep 2005
Posts: 6

PostPosted: Thu Oct 20, 2005 2:14 pm    Post subject: Re: Stoping JOB steps based on Return Code.
Reply with quote

Thanks for your help.

Regards,
Phani
Back to top
View user's profile Send private message
keler

New User


Joined: 20 Oct 2005
Posts: 1

PostPosted: Thu Oct 20, 2005 3:32 pm    Post subject: Re: Stoping JOB steps based on Return Code.
Reply with quote

If not sure the return code of previous steps is whether equal to 8 , you can add COND=(8,EQ,step5) to your jobcard from step 6 to step 15.
This is a example:
Code:
//STEP6   EXEC PGM=***,COND=(8,EQ,STEP5)
//SYSPRINT DD SYSOUT=*                 
//SYSIN    DD *                         
//STEP7   EXEC PGM=***,COND=(8,EQ,STEP5)
//SYSPRINT DD SYSOUT=*                 
//SYSIN    DD *                         
  ....                                 
//STEP15  EXEC PGM=***,COND=(8,EQ,STEP5)
//SYSPRINT DD SYSOUT=*                 
//SYSIN    DD *                         


Hope it useful
Regards
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 239
Location: Cincinnati OH USA

PostPosted: Fri Oct 21, 2005 12:56 am    Post subject:
Reply with quote

check the JCL manual for usage of IF ENDIF statements.



Dave
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us