For each invocation of PROC1, the following will execute the next step only if the previous steps are acceptable.
PROC1 PROC PRCSTEP1 EXEC ... ... IF PRCSTEP1.RC = 0 THEN PRCSTEP2 EXEC ... ... IF PRCSTEP2.RC <= 16 THEN PRSTEP3 EXEC ... ... ENDIF STEP3 ENDIF STEP2 If you want a subsequent invocation of PROC1 to be dependent on the processing of previous invocations, then you need something like STEP0001 EXEC PROC1,FILE=A1 IF STEP0001.PRCSTEP3.RC = 0 THEN STEP0002 EXEC PROC1,FILE=A2 IF (STEP0001.PRCSTEP3.RC = 0) & (STEP0002.PRCSTEP3.RC = 0) THEN STEP0003 EXEC PROC1,FILE=A3 ... -----Original Message----- From: Paul Ip Sent: Saturday, June 27, 2009 11:57 PM To: IBM-MAIN@bama.ua.edu Subject: Question if COND code / IF THEN struct Hi all, If I have an JCL with an instream PROC: PROC1 PROC PRCSTEP1 EXEC PGM=XXX INPUT DD DSN=&FILE PRCSTEP2 EXEC PGM=YYY INPUT DD DSN=&FILE PRCSTEP3 EXEC PGM=ZZZ INPUT DD DSN=&FILE PEND STEP0001 EXEC PROC1,FILE=A1 STEP0002 EXEC PROC1,FILE=A2 STEP0003 EXEC PROC1,FILE=A3 ... STEP000N EXEC PROC1,FILE=AN PRCSTEP1 will have an RC=0 PRCSTEP2 will have an RC=16 (but not a failure case) PRCSTEP3 will have an RC=0 My question is, how can I code the COND parameter or IF the ELSE on all PRCSTEPs so that all the PRCSTEPs can be executed with previous PROCSTEPs RC=0 *except* PRCSTEP2 can have a RC=0 to 16. I have tried using "RC.PRCSTEP2 = 16" for IF then ELSE before PRCSTEP1 (since STEP0002.PRCSTEP1 will be executed if RC<=16 of STEP0001.PRCSTEP2). However it failed with JCL error since invaild referback. Please give me a hint, thanks! Paul ---------------------------------------------------------------------- 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 ---------------------------------------------------------------------- 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