I have a great illustration of how Rexx tails work. Consider the following
(tested on Z) example. It shows that the different pieces of the tail are
not really different "things" at all. It does not matter how you get to a
particular tail value.

/* rexx test */                                                             
x = 'VX'   /* Value of X */                                                 
y = 'VY'   /* value of Y */                                                 
A.x.y = 'Foo'  /* Presumably A.VX.VY is set to "Foo" */                     
Combo = 'VX.VY'                                                             
Say A.Combo     /* Says "Foo": does not matter how you get to A.VX.VY! */   

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of Charles Mills
Sent: Monday, February 1, 2021 4:09 PM
To: [email protected]
Subject: Re: Rexx stem variable question

Thanks all. I am getting it now. I had the wrong mental model of how Rexx
stems work (and I suspect some others may also.)

I pictured it kind of like C or COBOL multi-dimensional arrays. I pictured
Rexx A.B.C.D being essentially analogous to C language A[B,C,D] or COBOL
A(B, C, D) albeit with "associative subscripts."

But it really is more like a one-dimensional array than an n-dimensional
array. A.B.C.D is kind of the same thing as A.ValueOfB_ValueOfC_ValueOfD.
The periods just separate the different variable names, making A.B.C.D
distinct from A.BCD. B.C.D is one "subscript," not three. There is only one
tail, a series of values essentially concatenated with periods, not a
hierarchy of tails.

The fact that it is one-dimensional explains why A.B. has no special
significance. 

A. is special; it is "all the possible tails of A" but A.B. is just "A.B
plus a period."

Charles

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

Reply via email to