The SET statement is not executed conditionally. For example, if the SET statement appears in an IF/THEN/ELSE/ENDIF statement construct, the value is assigned to the symbolic parameter regardless of the logic of the construct.
Regards, Jim On Fri, Feb 17, 2017 at 2:03 PM, George, William@FTB <[email protected] > wrote: > The JCL below > > 1. Sets symbolic &SFX = "A" > > 2. checks if a dataset exists, > > 3. if it does exist it changes the symbolic &SFX = "B" > > 4. for the dataset used in the Step3. > > However, processing ALWAYS falls into the THEN path even when the RC = 0. > What am I missing? > Note: this is just test JCL to verify the changing of the &SFX symbolic > works. > Thanks for any insights! > Bill > > //* > //SET1 SET SFX=A > //* > //CHKEXIST EXEC PGM=IDCAMS > //SYSPRINT DD SYSOUT=* > //SYSIN DD * > LISTCAT ENTRIES('Q6498.BIND.ENTLISTA') > /* > //CHECKIF IF CHKEXIST.RC < 4 THEN > //SET2 SET SFX=B > //CHECKIF ENDIF > //* > //STEP3 EXEC PGM=SORT > //SYSOUT DD SYSOUT=* > //SORTIN DD DISP=SHR,DSN=Q6498.BIND.ENTLIST&SFX > //SORTOUT DD DSN=DUMMY > //SYSIN DD * > SORT FIELDS=COPY > // > > > ______________________________________________________________________ > CONFIDENTIALITY NOTICE: This email from the State of California is for the > sole use of the intended recipient and may contain confidential and > privileged information. Any unauthorized review or use, including > disclosure or distribution, is prohibited. If you are not the intended > recipient, please contact the sender and destroy all copies of this email. > > ---------------------------------------------------------------------- > 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
