Hmmm!  You're right.  It's not the symbolic that is not allowed.  It's the 
comparison to non-numeric values that is not allowed.  Interesting!

This works:
1 //IFTHEN   JOB ,'IFTHEN TEST',NOTIFY=&SYSUID           
  IEFC653I SUBSTITUTION JCL - ,'IFTHEN TEST',NOTIFY=DVFJS
2 //         SET P1=1                                    
3 //DUMMY    EXEC PGM=IEFBR14                            
4 // IF (&P1 EQ 1) THEN                                  
  IEFC653I SUBSTITUTION JCL - (1 EQ 1)                   
5 //GOOD     EXEC PGM=IEFBR14                            
6 // ELSE                                                
7 //BAD      EXEC PGM=IEFBR14                            
8 // ENDIF                                               


This does not:
1 //IFTHEN   JOB ,'IFTHEN TEST',NOTIFY=&SYSUID                 
  IEFC653I SUBSTITUTION JCL - ,'IFTHEN TEST',NOTIFY=DVFJS      
2 //         SET P1='GOOD'                                     
3 //DUMMY    EXEC PGM=IEFBR14                                  
4 // IF (&P1 EQ GOOD) THEN                                     
  IEFC653I SUBSTITUTION JCL - (GOOD EQ GOOD)                   
5 //GOOD     EXEC PGM=IEFBR14                                  
6 // ELSE                                                      
7 //BAD      EXEC PGM=IEFBR14                                  
8 // ENDIF                                                     

       4 IEFC013I ERROR IN IF STATEMENT: GOOD NOT VALID

Nor this:
1 //IFTHEN   JOB ,'IFTHEN TEST',NOTIFY=&SYSUID           
  IEFC653I SUBSTITUTION JCL - ,'IFTHEN TEST',NOTIFY=DVFJS
2 //         SET P1='GOOD'                               
3 //DUMMY    EXEC PGM=IEFBR14                            
4 // IF (&P1 = 'GOOD') THEN                              
  IEFC653I SUBSTITUTION JCL - (GOOD = 'GOOD')            
5 //GOOD     EXEC PGM=IEFBR14                            
6 // ELSE                                                
7 //BAD      EXEC PGM=IEFBR14                            
8 // ENDIF                                               

       4 IEFC629I INCORRECT USE OF APOSTROPHE ON THE IF STATEMENT
       4 IEFC629I INCORRECT USE OF APOSTROPHE ON THE IF STATEMENT

Wish I would have realized this a few years ago!




>________________________________
> From: Paul Gilmartin <[email protected]>
>To: [email protected] 
>Sent: Friday, November 8, 2013 9:23 AM
>Subject: Re: JCL
> 
>
>On Fri, 8 Nov 2013 08:04:51 -0800, Frank Swarbrick wrote:
>
>>Off of the top of my head, IF statements should be able to check SET parms 
>>for values.
>>
>>Many other things, surely, but this limitation seems most egregious.
>
>Again, in my recollection without re-checking the JCL Ref, there's no
>such limitation; in fact it's explicitly allowed.
>
>In fact, I do it routinely, but given the weaselly specification of IF,
>that's no guarantee that it's supported.  I try to stay within the
>constructs documented as supported.
>
>-- gil
>
>----------------------------------------------------------------------
>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