Cond codes.

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
chintu1680
Member
Posts: 10
Joined: Tue Dec 11, 2007 1:33 am

Cond codes.

Post by chintu1680 » Mon Feb 18, 2008 10:04 pm

Hi,
My question is about the cond codes.

//JOB3 JOB (A123), 'DAVID ZOWIE'
//STEP1 EXEC PGM= PROGRAM1
//STEP2 EXEC PGM= PROGRAM2
//STEP3 EXEC PGM= PROGRAM3,
// COND=(8,GE),(80,LE STEP1)
//
CAN ANY BODY EXPLAIN ME ABOUT THIS IN DETAIL.
I AM A LEARNER .IAM LITTLE BIT CONFUSED ABOUT THE COND CODES.
[/code]

User avatar
DavidatK
Active Member
Posts: 65
Joined: Tue Mar 27, 2007 8:41 am
Location: Troy, MI USA

Post by DavidatK » Tue Feb 19, 2008 4:46 am

chintu1680,

Just to get this out of the way it?s COND=((8,GE),(80,LE,STEP1))

CONDition code processing is one of the strangest things IBM has done. You need to think ?backwards? . It is not if the COND is satisfied Execute the step, it?s if the COND is satisfied, Skip the step. And you need to read the COND from Right to Left. Not Left to Right like we read a book.

Now, if you have multiple COND you must understand that they are ?or? connectors. If this ?or? that condition is true, skip this step.

So what you have above says, that in STEP3, skip STEP3 if Any previous return code in this job was (Right to Left) GE to 8. Or skip STEP3 if STEP1 return code LE 80.

Well, given that you are going to skip STEP3 if STEP1 is LE 80 or ANY step GE 8 (including STEP1), I?d say that STEP3 will never run.

Dave

chintu1680
Member
Posts: 10
Joined: Tue Dec 11, 2007 1:33 am

Thanks

Post by chintu1680 » Wed Feb 20, 2008 7:46 pm

Hi Dave,
Thanks a lot for clearing out my confusion.

kaitki
Member
Posts: 4
Joined: Wed Mar 12, 2008 12:38 pm

Re: Cond codes.

Post by kaitki » Fri Mar 14, 2008 5:06 pm

I am confused by the following piece of code that I came across -

//Step1 Exec pgm=pgm1
//step2 Exec pgm=pgm2,cond=(0,LT)

Would it cause the step 2 to be executed only in case pgm1 returns 0, or would it cause step2 to be executed always because negative return codes are never returned?

Thanks

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

condition codes in jcl

Post by Krishna » Sat Mar 15, 2008 10:01 am

Hi Kaitki,

Step 2 will execute only when Step1 retun 0.

Step 2 wont get executed if Step1 returns any other codes like 1,2,3,4......

For more details visit
http://www.mainframegurukul.com/srcsinc ... pter5.html
Last edited by Krishna on Wed Jun 17, 2009 1:23 pm, edited 1 time in total.

kaitki
Member
Posts: 4
Joined: Wed Mar 12, 2008 12:38 pm

Re: condition codes in jcl

Post by kaitki » Mon Mar 17, 2008 12:12 pm

Thanks Krishna, I thought as much, but came across confusing contrary explanations in a particular textbook.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others