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

Condition code checking


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

New User


Joined: 17 May 2007
Posts: 11
Location: Chennai, India

PostPosted: Tue Mar 04, 2008 2:13 am
Reply with quote

Hello All,

I want to check the condition codes in a job which is as follows.

//STEP01 EXEC PGM=AAAA,COND=(0,LT),
...............
//STEP02 EXEC PGM=IEBGENER,COND=(0,NE)
..............
//STEP03 EXEC PGM=BBBBB,COND=(0,NE)
..................
//STEP05 EXEC PGM=IDCAMS,COND=(4,LT,STEP03.G)

I want STEP05 to execute only if STEP03 ends with a return code of 4 or less. The above condition checking works fine if STEP03 runs fine.

However, when STEP03 itself is not executed because of return codes from STEP01 or STEP02, the condition code in STEP05 is not checked and STEP05 gets executed.

Can anyone suggest a way to resolve this?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Mar 04, 2008 3:10 am
Reply with quote

Hello,

Add the 0,NE to the STEP05 COND=.
Back to top
View user's profile Send private message
jagadeeshkumar

New User


Joined: 17 May 2007
Posts: 11
Location: Chennai, India

PostPosted: Tue Mar 04, 2008 4:32 am
Reply with quote

Hi,

I changed the condition code in STEP05 as

//STEP05 EXEC PGM=IDCAMS,COND=((4,LT,STEP03),(0,NE))

Now, STEP05 is not executed. The return code of the previous steps are

STEP1 : 0
STEP2 : 0
STEP3 : 4
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Mar 04, 2008 7:01 am
Reply with quote

Hello,

I believe you need to add the 0,NE for each of the 3 prior steps.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 04, 2008 12:46 pm
Reply with quote

IF / THEN / ELSE allows you to test if a previous step has run or not, and you can then specify that if STEP03 has not processed, then do not process STEP05.
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top