IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 7312
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 All times are GMT + 6 Hours
Forum Index -> JCL & VSAM
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts JCL for replacing code in Cobol JCL & VSAM 8
No new posts Easytrieve EZABX007 with error code 0... CA Products 7
No new posts a copybook getting improper values in... COBOL Programming 7
This topic is locked: you cannot edit posts or make replies. VSAM I/O - Extended Addressability - ... JCL & VSAM 12
No new posts Force a Return Code and print error m... SYNCSORT 30

Back to Top