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]
Cond codes.
Moderators: Frank Yaeger, DikDude, Moderator Group
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
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
-
- Member
- Posts: 10
- Joined: Tue Dec 11, 2007 1:33 am
Thanks
Hi Dave,
Thanks a lot for clearing out my confusion.
Thanks a lot for clearing out my confusion.
Re: Cond codes.
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
//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
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
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.
Regards,
Krishna
Facebook --> http://www.facebook.com/mainframegurukul
Connect with RAMESH KRISHNA REDDY --> http://www.linkedin.com/in/rameshkrishnareddy
Twitter --> https://twitter.com/mainframegurkul
http://www.mainframetutorials.com
Krishna
Facebook --> http://www.facebook.com/mainframegurukul
Connect with RAMESH KRISHNA REDDY --> http://www.linkedin.com/in/rameshkrishnareddy
Twitter --> https://twitter.com/mainframegurkul
http://www.mainframetutorials.com
Re: condition codes in jcl
Thanks Krishna, I thought as much, but came across confusing contrary explanations in a particular textbook.
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page