Simple Symbols
A simple symbol does not contain any periods and does not start with a digit (0–9).
By default, its value is the characters of the symbol (that is, translated to uppercase). If the symbol has
been assigned a value, it names a variable and its value is the value of that variable.
These are simple symbols:
FRED
Whatagoodidea? /* Same as WHATAGOODIDEA? */
?12
<.D.A.T.E>
Compound Symbols
A compound symbol permits the substitution of variables within its name when you refer to it. A
compound symbol contains at least one period and at least two other characters. It cannot start with a digit
or a period, and if there is only one period in the compound symbol, it cannot be the last character.
The name begins with a stem (that part of the symbol up to and including the first period). This is followed
by a tail, parts of the name (delimited by periods) that are constant symbols, simple symbols, or null. The
derived name of a compound symbol is the stem of the symbol, in uppercase, followed by the tail, in
which all simple symbols have been replaced with their values. A tail itself can be comprised of the
characters A–Z, a–z, 0–9, and @#£$.!?and underscore. The value of a tail can be any character
string, including the null string and strings containing blanks. For example:
taila='* ('
tailb=''
stem.taila=99
stem.tailb=stem.taila
say stem.tailb /* Displays: 99 */
/* But the following instruction would cause an error */
/* say stem.* ( */
You cannot use constant symbols with embedded signs (for example, 12.3E+5) after a stem; in this case,
the whole symbol would not be a valid symbol.
These are compound symbols:
FRED.3
Array.I.J
AMESSY..One.2.
<.F.R.E.D>.<.A.B>
Before the symbol is used (that is, at the time of reference), the language processor substitutes the values
of any simple symbols in the tail (I, J, and One in the examples), thus generating a new, derived name.
This derived name is then used just like a simple symbol. That is, its value is by default the derived name,
or (if it has been used as the target of an assignment) its value is the value of the variable named by the
derived name.
The substitution into the symbol that takes place permits arbitrary indexing (subscripting) of collections of
variables that have a common stem. Note that the values substituted can contain any characters (including
periods and blanks). Substitution is done only one time.
To summarize: the derived name of a compound variable that is referred to by the symbol
s0.s1.s2. --- .sn
is given by
d0.v1.v2. --- .vn
REXX General Concepts
122
CICS TS for VSE/ESA: REXX Guide