On Fri, Feb 17, 2017 at 1:03 PM, George, William@FTB <bill.geo...@ftb.ca.gov > 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! > // SET statements are _always_ processed, regardless of any // IF condition. ref: https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ieab600/iea3b6_Considerations_for_using_the_SET_statement.htm > 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN > -- "Irrigation of the land with seawater desalinated by fusion power is ancient. It's called 'rain'." -- Michael McClary, in alt.fusion Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN