On Tue, 17 Jul 2012 16:43:32 -0500, Bass, Walter W wrote:

>Try this ...
>
>//***** SAVE CURRENT VALUE OF MYSYM
>// SET SAVESYM=&MYSYM
>//***** SET MYSYM TO A NEW VALUE
>// SET MYSYM='NEWVAL'
>
>...
>//***** RESTORE MYSYM
>// SET MYSYM=&SAVESYM
>
>Probably not the answer you wanted, but it works.  
>
Actually, it doesn't work:

        3 //BEFORE   EXEC  PGM=IEFBR14,PARM='&MYSYM.X'            
          //*                                                     
          //***** SAVE CURRENT VALUE OF MYSYM                     
        4 // SET SAVESYM=&MYSYM                                   
          //***** SET MYSYM TO A NEW VALUE                        
        5 // SET MYSYM='NEWVAL'                                   
        6 //DURING   EXEC  PGM=IEFBR14,PARM='&MYSYM.X'            
          //*                                                     
          //***** RESTORE MYSYM                                   
          IEFC653I SUBSTITUTION JCL - PGM=IEFBR14,PARM='NEWVALX'  
        7 // SET MYSYM=&SAVESYM                                   
          IEFC653I SUBSTITUTION JCL - MYSYM=&MYSYM                
        8 //AFTER    EXEC  PGM=IEFBR14,PARM='&MYSYM.X'            
          IEFC653I SUBSTITUTION JCL - PGM=IEFBR14,PARM='&MYSYMX'  
        9 //                                                      

... notice the difference between lines 3 and 8.

>Another possibility is to take advantage of the fact that symbols that
>are SET within a PROC automatically revert to their former value after
>the PROC terminates.
>
That one I believe.  Steve suggested it too.  But in open code, there
seems to be no solution.  Symbols are initially in a Garden of Eden
state (which John G. dislikes).  Once they leave they can never return.

-- gil

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

Reply via email to