Did you mean RC > 0  ?

Sent from my iPhone

> On Feb 17, 2017, at 14:29, Hardee, Chuck <[email protected]> 
> wrote:
> 
> William,
> 
> Here's a modified version of your test without SETs:
> 
> //*                                         
> //CKEXIST1 EXEC PGM=IDCAMS                  
> //SYSPRINT DD SYSOUT=*                      
> //SYSIN    DD *                             
>   LISTCAT ENTRIES('S01CH.TEST.LOADLIB')    
> /*                                          
> //CHECKIF1 IF CKEXIST1.RC < 4 THEN          
> //IFEXECED EXEC PGM=IEFBR14                 
> //CHECKIF1 ENDIF                            
> //*                                         
> //CKEXIST2 EXEC PGM=IDCAMS                  
> //SYSPRINT DD SYSOUT=*                      
> //SYSIN    DD *                             
>   LISTCAT ENTRIES('S01CH.TEST.NO.LOADLIB') 
> /*                                          
> //CHECKIF2 IF CKEXIST2.RC < 4 THEN          
> //IFEXECED EXEC PGM=IEFBR14                 
> //CHECKIF2 ENDIF                            
> //*                                         
> 
> And the results:
> -STEPNAME PROCSTEP    RC 
> -CKEXIST1             00 
> -IFEXECED             00 
> -CKEXIST2             04 
> -IFEXECED          FLUSH 
> IEF404I S01CHIFT - ENDED
> 
> The first dataset exists, the second doesn't.
> 
> Is this what you're trying to accomplish or are you truly wanting variable 
> SETs?
> 
> C-
> 
> 
> 
> Charles (Chuck) Hardee
> Senior Systems Engineer/Database Administration
> EAS Information Technology
> 
> Thermo Fisher Scientific
> 300 Industry Drive | Pittsburgh, PA 15275
> Phone +1 (724) 517-2633 | Mobile +1 (412) 877-2809 | FAX: +1 (412) 490-9230
> [email protected]  | www.thermofisher.com
> 
> WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of 
> this e-mail or the information herein by anyone other than the intended 
> recipient, or an employee or agent of a system responsible for delivering the 
> message to the intended recipient, is prohibited. If you are not the intended 
> recipient, please inform the sender and delete all copies.
> 
> 
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On 
> Behalf Of George, William@FTB
> Sent: Friday, February 17, 2017 2:27 PM
> To: [email protected]
> Subject: Re: JCL IF Condition - I'm Missing Something
> 
> Thanks. I guess I'll have to attack the setting of the suffix differently 
> then.
> 
> 
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On 
> Behalf Of Jim Brooks
> Sent: Friday, February 17, 2017 11:26 AM
> To: [email protected]
> Subject: Re: JCL IF Condition - I'm Missing Something
> 
> 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
> 
> ----------------------------------------------------------------------
> 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

Reply via email to