Hi, I am writing a general subroutine that would replace system symbols in any text string. I had a fairly complicated piece of code to do the correct symbol replacement, including possible symbol concatenation, obeying all the replacement rules I could remember. My code still had somewhere to go to be closer to what I wanted, when I accidentally ran the below code.
The parameter being passed is a text string, so no REXX Variable replacement should be made. What I think is happening, the &xxxx values are being recognised as symbols and being replaced, then the whole text string is turned into a symbol name , i.e. &textstring., and since that has no replacement is being returned as an unresolved symbol name. Thus, end result, my text string gets any symbol name replaced as desired, but is uppercased, prefixed with "&" and suffixed with "." I can live with that a simple coding exercise. So far I have not seen anyone identify where this is fully documented. On Wed, 25 Mar 2020 04:43:52 -0500, Bruce Hewson <[email protected]> wrote: >Hi, > >In a REXX exec I was building I stumbled onto:- > >Say 'MVSVAR'("SYMDEF",'testing &sysname in &sysplex') > >which provides an unexpected result > >&'TESTING SYSA IN PLEX01'. > >The symbols &SYSNAME and &SYSPLEX were replaced. >And, sadly, the whole lot was uppercased. > >Couldn't find this behaviour documented. > >Regards >Bruce > Regards Bruce ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
