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
 

 

Condition code checking

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Condition code checking
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

Site Director


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

PostPosted: Tue Mar 04, 2008 3:10 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Mar 04, 2008 7:01 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 04, 2008 12:46 pm    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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