Well, I solved it //MYPROC PROC PRM1=,PRM2=,LBL= //STEP1 EXEC PGM= etc. // IF (&LBL..STEP1.RC = 4) THEN //STEP2 EXEC PGM= etc. // ENDIF
//FOO EXEC MYPROC,PRM1=A,PRM2=B,LBL=FOO //FOO EXEC MYPROC,PRM1=C,PRM2=D,LBL=BAR It's an invitation to errors. You have to code the label twice: once as the label of the procstep and once in LBL=. They did an incomplete job on symbols. If a PROC had access to a symbol &SYSPROCSTEPNAME it would solve this problem. In the same vein, I just voted up an RFE to add a symbol for the return code(s). Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Charles Mills Sent: Friday, December 11, 2020 11:14 AM To: [email protected] Subject: Re: How test correct procstep RC with JCL IF? Oh for gosh sakes! I had the bright idea of passing a unique label for IF to test so the PROC becomes //MYPROC PROC PRM1=,PRM2=,LBL= //&LBL EXEC PGM= etc. // IF (&LBL..RC = 4) THEN //STEP2 EXEC PGM= etc. // ENDIF //X EXEC MYPROC,PRM1=A,PRM2=B,LBL=FOO //Y EXEC MYPROC,PRM1=C,PRM2=D,LBL=BAR But nooooo! 9 IEFC662I INVALID LABEL Apparently you can't use a symbol for a step name? Is that right? Grrrr. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Charles Mills Sent: Friday, December 11, 2020 7:27 AM To: [email protected] Subject: How test correct procstep RC with JCL IF? I want to have a PROC //MYPROC PROC PRM1=,PRM2= //STEP1 EXEC PGM= etc. // IF (STEP1.RC = 4) THEN //STEP2 EXEC PGM= etc. // ENDIF And then in a job execute the PROC several times: //X EXEC MYPROC,PRM1=A,PRM2=B //Y EXEC MYPROC,PRM1=C,PRM2=D Question: Will the IF in the proc test the RC for the STEP1 in that execution of the proc? Or some other execution of the PROC, perhaps the first? Is there a way to make it test "its own" STEP1.RC? Something kind of like (*.STEP1.RC = 4) ? I don't see any examples in the JCL manual of IF statements inside a PROC. Thanks, Charles ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
