IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COND=EVEN along with return code test


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
paramoberoi

New User


Joined: 26 Oct 2010
Posts: 12
Location: USA

PostPosted: Thu Jun 18, 2015 8:21 am
Reply with quote

Hi

My requirement is to execute a step (STEP03) in a JCL if any step prior to it abends or returns CC > 4.

In order to implement it I coded below JCL:


Code:

//STEP01 EXEC  PGM=IDCAMS       
//SYSPRINT DD  SYSOUT=*         
//IMSDUMP  DD  SYSOUT=*         
//SYSIN    DD  *                 
  SET MAXCC=6                   
/*                               
//STEP02  EXEC PGM=IEFBR14     
//*       
//STEP03  EXEC PGM=IEFBR14,     
//             COND=(EVEN,(4,GE))
/*                               



and to my surprise I got following output:
Code:

PROCSTEP    RC
STEP01      06
STEP02      00
STEP03   FLUSH


As per manual
if NO step abends and NO test is satisfied the step should be executed.

Can you please help me understand why didn't STEP03 execute in this case?

I do have workaround for this problem as below but I am curious to understand why does above solution not work.
Code:

//STEP01 EXEC  PGM=IDCAMS               
//SYSPRINT DD  SYSOUT=*                 
//IMSDUMP  DD  SYSOUT=*                 
//SYSIN    DD  *                         
  SET MAXCC=6                           
/*                                       
//STEP02  EXEC PGM=IEFBR14,             
//             COND=(4,LT)               
//STEP03  EXEC PGM=IEFBR14,             
//             COND=(EVEN,(0,EQ,STEP02))
/*                                       


Thanks
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jun 18, 2015 12:37 pm
Reply with quote

From your link:
Quote:

Note: When the COND parameter does not name a previous step, the system tests all previous steps. If any test is satisfied, the system bypasses the current step.
Back to top
View user's profile Send private message
paramoberoi

New User


Joined: 26 Oct 2010
Posts: 12
Location: USA

PostPosted: Thu Jun 18, 2015 5:51 pm
Reply with quote

ahh.. Thanks for pointing it out.

Regards
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jun 19, 2015 2:34 am
Reply with quote

Using IF/THEN/ELSE/ENDIF would be easier to understand than COND for most of us.
Back to top
View user's profile Send private message
paramoberoi

New User


Joined: 26 Oct 2010
Posts: 12
Location: USA

PostPosted: Fri Jun 19, 2015 3:04 am
Reply with quote

I agree. They are easier to read and understand . In this case required code would have been simply
Code:

// IF ABEND OR RC > 4 THEN
//STEP03  EXEC PGM=IEFBR14
// ENDIF                   
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top