Thanks John
Actually I did see in my research of what I could be missing so one of my tests 
I placed another SORT step inside the THEN - ENDIF condition and it too was 
processed. That is, as mentioned the THEN condition always processed when the 
CHECKIF return code was RC=0. 
I probably should have shown that test without the SET inside the THEN path as 
the example. :(

Bill

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of John McKown
Sent: Friday, February 17, 2017 11:17 AM
To: [email protected]
Subject: Re: JCL IF Condition - I'm Missing Something

On Fri, Feb 17, 2017 at 1:03 PM, George, William@FTB <[email protected]

​// 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 [email protected] 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 
[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

Reply via email to