On Fri, 17 Feb 2017 13:16:40 -0600, John McKown wrote:

>On Fri, Feb 17, 2017 at 1:03 PM, George, William 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
>​ 
A better way to understand this is that symbols are SET and resolved
by the reader process, long before your job begins execution.

You need to replicate the following job step(s) in both the THEN and
ELSE clauses with the trivial difference in the suffix.

Or, do the whole thing in Rexx.

I think the designers of JCL believed that any programmer
who doesn't know a priori whether his data set exists is using
an out-of-control process.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to