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: 241
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 Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am


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