Well, the first thing I see is that &sysname and &sysplex are not REXX 
variables, so what is happening is not the REXX substitution given in the 
manual. My suspicions is that there is no REXX substitution in 
MVSVAR('SYMDEF','foo'), but that the author is describing the normal REXX 
processing of any argument in any function, i.e.,

   foo = bar
   baz = MVSVAR('SYMDEF',foo)

gives the same result as

   baz = MVSVAR('SYMDEF','bar')

I don't have a system to try it on, but give it a whirl and see what happens.



--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


________________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of 
Paul Gilmartin <[email protected]>
Sent: Thursday, March 26, 2020 9:39 AM
To: [email protected]
Subject: Re: REXX MVSVAR SYMDEF behavoiur

On Wed, 25 Mar 2020 04:43:52 -0500, Bruce Hewson wrote:
>
>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.
>
I wonder how this is influenced by the statement in the Ref.:
    The MVSVAR('SYMDEF',string) function goes through REXX substitution for 
string first,
    the result of which must be a 1-8 character symbolic-name specifying the 
symbol that
    has been defined in the SYMDEF statement. Any other values including REXX 
delimiters
    might cause unpredictable results.

... since the value of an unassigned symbol is its name, uppercased.
What happens if you provide values for the symbol-tokens?:

testing = 'xxxx'
in = 'yyyy'
Say 'MVSVAR'("SYMDEF",'testing &sysname in &sysplex')

... pretty weird regardless.

-- 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