This is one of many such discussions we have had here over the years. Symbols were a good notion, or wouild have been if they had been implemented more generously. They were not, and anyone who, seeing simplistic uses of them, dreams of using them in more interesting, non-trivial ways is almost always disappointed in the attempt to do so.
John Gilmore, Ashland, MA 01721 - USA On 7/17/12, Paul Gilmartin <paulgboul...@aim.com> wrote: > 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN