Page 1 of 1

Cond codes.

Posted: Mon Feb 18, 2008 10:04 pm
by chintu1680
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]

Posted: Tue Feb 19, 2008 4:46 am
by DavidatK
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

Thanks

Posted: Wed Feb 20, 2008 7:46 pm
by chintu1680
Hi Dave,
Thanks a lot for clearing out my confusion.

Re: Cond codes.

Posted: Fri Mar 14, 2008 5:06 pm
by kaitki
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

condition codes in jcl

Posted: Sat Mar 15, 2008 10:01 am
by Krishna
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

Re: condition codes in jcl

Posted: Mon Mar 17, 2008 12:12 pm
by kaitki
Thanks Krishna, I thought as much, but came across confusing contrary explanations in a particular textbook.