> Read what I wrote. 

 I did. You wrote " And if BAR || '2' is an assigned variable" in response to " 
x =value('foo.'bar'2')", and the question has no relevance to that code, which 
has no variable called BAR or BAR2. The point at issue was the behavior of the 
value() BIF, which you kept ignoring. Now that you have noticed that to be the 
issue, I see where the confusion came in; I was thinking of the .stem class in 
OOREXX rather than the way value() accesses compound variables.

/* REXX semantics for the value() BIF */
/* trace i */
lvar = 'left'
uvar = LEFT

mystem = .stem~new('MYSTEM.')
say 'uninitialized mystem[left2] =' mystem[lvar'2']
say 'uninitialized mystem[LEFT2] =' mystem[uvar'2']

/*
    Produces
    uninitialized mystem[left2] = MYSTEM.left2
    uninitialized mystem[LEFT2] = MYSTEM.LEFT2
*/

mystem[lvar'2'] = LOWER
mystem[uvar'2'] = UPPER
say 'initialized mystem[left2] =' mystem[lvar'2']
say 'initialized mystem[LEFT2] =' mystem[uvar'2']

/*
    Produces
    initialized mystem[left2] = MYSTEM.left2
    initialized mystem[left2] = UPPER
*/

say 'uninitialized head.left2 =' value('head.'lvar'2')
say 'uninitialized HEAD.left2 =' value('HEAD.'lvar'2')
say 'uninitialized head.LEFT2 =' value('head.'uvar'2')
say 'uninitialized HEAD.LEFT2 =' value('HEAD.'uvar'2')

/*
    Produces
    uninitialized head.left2 = HEAD.LEFT2
    uninitialized HEAD.left2 = HEAD.LEFT2
    uninitialized head.LEFT2 = HEAD.LEFT2
    uninitialized HEAD.LEFT2 = HEAD.LEFT2
*/

call value 'head.'lvar'2', LOWER LOWER
call value 'HEAD.'lvar'2', UPPER LOWER
call value 'head.'uvar'2', LOWER UPPER
call value 'HEAD.'uvar'2', UPPER UPPER

say 'initialized head.left2 =' value('head.'lvar'2')
say 'initialized HEAD.left2 =' value('HEAD.'lvar'2')
say 'initialized head.LEFT2 =' value('head.'uvar'2')
say 'initialized HEAD.LEFT2 =' value('HEAD.'uvar'2')

/*
    Produces
    initialized head.left2 = UPPER UPPER
    initialized HEAD.left2 = UPPER UPPER
    initialized head.LEFT2 = UPPER UPPER
    initialized HEAD.LEFT2 = UPPER UPPER
*/

Unfortunately, TSO/E does not support that.



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

________________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of 
Paul Gilmartin <[email protected]>
Sent: Tuesday, May 15, 2018 12:40 AM
To: [email protected]
Subject: Re: Heretic alert: I really detest TSO REXX (the language)

On Mon, 14 May 2018 20:21:49 +0000, Seymour J Metz wrote:
>
>> And if BAR || '2' is an assigned variable
>
>The statement in question was
>
>     x =value('foo.'bar'2')
>
>It has nothing to do with a variable called BAR2, but rather a variable called 
>BAR.
>
Read what I wrote.  Not the variable called "BAR2", but the variable called 
"value
(not name) of BAR with digit 2 appended.  We had this discussion several years
ago; you were wrong then; you remain wrong now.

Sample Rexx code:
    trace R
    signal on novalue
    BAR = 'Wombat'

    drop WOMBAT2
    say '==>' value( 'foo.'bar'2' )

    WOMBAT2 = 'XYZZY'
    say '==>' value( 'foo.'bar'2' )

And output, traced:
     2 *-* signal on novalue
     3 *-* BAR = 'Wombat'

     5 *-* drop WOMBAT2
     6 *-* say '==>' value( 'foo.'bar'2' )
       >V>   "Wombat"
==> FOO.WOMBAT2

     8 *-* WOMBAT2 = 'XYZZY'
     9 *-* say '==>' value( 'foo.'bar'2' )
       >V>   "Wombat"
==> FOO.XYZZY

>> For safety, you need to:
>>     TAIL = bar'2'
>>     X = foo.TAIL
>
>ITYM for safety you need to use the value() BIF.
>
No, I meant what I said.

-- gil

>> How about in JCL?
>
>Yes, I use inline data in JCL, but a lot less than when I was dealing with 
>cards. Most of the inline data that I've seen in the last few decades 
>shouldn't have been inline.
>
???

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