On 6/3/2011 3:06 PM, Rick Fochtman wrote:
------------------------------------<snip>------------------------------------
Normally (by default), if a jobstep abends, subsequent steps are flushed.
I have a requirement in a job that, if a particular step of the job abends
with a particular code, then the job should continue. However, if any
subsequent step abends, then further steps should be flushed. This seems
unfortunately difficult to arrange. For example:
//COND1 EXEC PGM=SETCOND,PARM=0
//COND2 EXEC PGM=SETCOND,PARM=U111
// IF (COND2.RUN=TRUE OR COND2.ABENDCC=U0111) THEN
//COND3 EXEC PGM=SETCOND,PARM=8
//COND4 EXEC PGM=SETCOND,PARM=U222
//COND5 EXEC PGM=SETCOND,PARM=0
//COND6 EXEC PGM=SETCOND,PARM=0
// ENDIF
Step COND2 abends with U0111, then the job continues. However, then COND4
abends with U0222 ... and yet COND5 and COND6 still run. (Yes, I can see *why*
... but that's no help.) I can't find any easy way to construct the job so
that an abend in COND2 will let things continue but an abend in a step after
COND2 will flush the rest of the job.
The best I've found so far is this, but it's pretty ugly and I don't want to
use it if I can possibly help it:
//COND1 EXEC PGM=SSCOND,PARM=0
//COND2 EXEC PGM=SSCOND,PARM=U111
// IF (COND2.RUN=TRUE OR COND2.ABENDCC=U0111) THEN
//COND3 EXEC PGM=SSCOND,PARM=8
// IF (COND3.RUN AND COND3.ABEND=FALSE) THEN
//COND4 EXEC PGM=SSCOND,PARM=U222
// ENDIF
// IF (COND4.RUN AND COND4.ABEND=FALSE) THEN
//COND5 EXEC PGM=SSCOND,PARM=0
// ENDIF
// IF (COND5.RUN AND COND5.ABEND=FALSE) THEN
//COND6 EXEC PGM=SSCOND,PARM=0
// ENDIF
// ENDIF
There ought to be a better way! Have I missed something obvious? Can anyone
offer a suggestion?
---------------------------------<unsnip>------------------------------------
You keep using PARM= values in your examples. Try looking at the COND= parameter
of the EXEC statement.
Rick
PARM values are used to set return codes from this code,
I imagine. Did you mean to say:
You keep using IF / THEN in your examples. Try looking at the
COND= parameter of the EXEC statement.
?
--
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
* To get a good Return on your Investment, first make an investment!
+ Training your people is an excellent investment
* Try our new tool for calculating your Return On Investment
for training dollars at
http://www.trainersfriend.com/ROI/roi.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html