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
 

 

COND=EVEN along with return code test

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: COND=EVEN along with return code test
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Jun 18, 2015 12:37 pm    Post subject: Reply to: COND=EVEN along with return code test
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    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Fri Jun 19, 2015 2:34 am    Post subject:
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    Post subject:
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    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 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
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
No new posts COOLGEN - TSO TEST FACILITY indianrajput CA Products 4 Wed Nov 02, 2016 9:28 pm


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