Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 252
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us