On Sun, 28 Jun 2009 01:56:59 -0500, Paul Ip <[email protected]> wrote:
>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 A slight syntax correction with your post for IF/THEN/ENDIF - when specifying stepname/procstepname, the ".RC" follows. More to the point, yes, it would be useful to have the "RUN" condition not be so tight that it permits a "not yet declared" stepname/procstepname exactly for this purpose. As a circumventive measure, one, less desirable choice, is to resort to either coding multiple PROC instances with specific check conditions or use JCL INCLUDE statements to externalize your individual PROC rqmt conditions and enclose the IF/THEN/ENDIF statements as needed for the first and subsequent PROC executions. The interpreter is so tight that I was unable to use JCL SET symbolics with IF/THEN/ENDIF statements, attempting to set a "blank" SET symbol for the first execution of the PROC and follow that with another SET overriding the initial value to add the additional test after the first execution -- such as: // SET RUNCHECK= //PROC1 PROC // IF RC = 0 &RUNCHECK THEN //PRCSTEP1 EXEC PGM=IKJEFT01,PARM=TIME //SYSTSPRT DD SYSOUT=* //SYSTSIN DD DUMMY // ENDIF // IF RC = 0 &RUNCHECK THEN //PRCSTEP2 EXEC PGM=IKJEFT01,PARM=BOGUS //SYSTSPRT DD SYSOUT=* //SYSTSIN DD DUMMY // ENDIF // IF RC = 0 &RUNCHECK THEN //PRCSTEP3 EXEC PGM=IKJEFT01,PARM=TIME //SYSTSPRT DD SYSOUT=* //SYSTSIN DD DUMMY // ENDIF // PEND //STEP0001 EXEC PROC1 // SET RUNCHECK='OR (PRCSTEP2.RUN AND PRCSTEP2.RC LT 16)' //STEP0002 EXEC PROC1 //STEP0003 EXEC PROC1 Oh well - another strike against JCL coding optimization attempts, while having somewhat similar angst with "nested PROCs" to some degree, mostly with restart/recovery attempts. Scott Barry SBBWorks, Inc. ---------------------------------------------------------------------- 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

