I like using COND= on the JOB card. Suppose each step must end with an RC LE 0.
//MYJOB JOB COND=(4,LE) This flushes the remaining steps in a job after the step which gets an RC greater than 4. Of course, you can't have a different RC for flushing based on the individual steps. That requires nesting the IF //STEP1 EXEC PGM= // IF (STEP1.RC LE 4) THEN //STEP2 EXEC PGM= // IF (STEP2.RC LE 8) THEN //STEP3 EXEC PGM= // IF (STEP3.RC EQ 0) THEN //STEP4 EXEC PGM= // ENDIF // ENDIF // ENDIF John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * [email protected] * www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM > -----Original Message----- > From: IBM Mainframe Discussion List > [mailto:[email protected]] On Behalf Of Mark Pace > Sent: Wednesday, January 19, 2011 7:58 AM > To: [email protected] > Subject: If Else JCL question > > Seems to be a very rookie question, but I can't find the answer. > > I have a series of JCLs that I want to put together as 1 JCL > with IF THEN to > test RC. What I can't find is a way to stop the JCL if a > step has a bad RC. > ie: > STEP1 > IF (STEP1.RC EQ 0) then > STEP2 > ELSE > ABEND or GOTO EOJ or somehow end this thing > ENDIF > IF (STEP2.RC etc, etc) > > VSE has labels so I can use a GOTO, but I see nothing like > that in z/OS > JCL. > > -- > Mark D Pace > Senior Systems Engineer > Mainline Information Systems > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: GET IBM-MAIN INFO > Search the archives at http://bama.ua.edu/archives/ibm-main.html > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

