Talk:CLP ILE

From MidrangeWiki
Revision as of 20:55, 27 May 2005 by Denny (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A useful trick that works with CLLE but not CLP is that parameters can be optional. You get an escape message MCH3601 when you attempt to use a variable that was omitted on the CALL.

PGM        (&LIB_P  &REPLY_P &REPLY2_P)  
...
CHGVAR     &LIB &LIB_P
MONMSG     MCH3601 EXEC(CHGVAR &LIB 'QTEMP') 
CHGVAR     &REPLY &REPLY_P                                 
MONMSG     MCH3601                                         
IF         (&REPLY *EQ ' ') DO                             
  SNDUSRMSG  MSG('Do you want to clear the model node +    
               files (CUSTOMER, VENDOR, PRODUCT)? Y | +    
               N') VALUES(Y N) TOMSGQ(*) MSGRPY(&REPLY)    
  ENDDO                                                    
CHGVAR     &REPLY2 &REPLY2_P                               
MONMSG     MCH3601                                         
IF         (&REPLY2 *EQ ' ') DO                            
SNDUSRMSG  MSG('Do you want to clear the demo screen +     
             values? Y | N') VALUES(Y N) TOMSGQ(*) +       
             MSGRPY(&REPLY2)                               
  ENDDO