IBM SC34-5764-01 Server User Manual


 
pull amount name
if datatype(amount)='CHAR' then leave
total.name = total.name + amount
end
Note: You can always obtain the value that has been assigned to the whole collection of variables by
using the stem. However, this is not the same as using a compound variable whose derived name
is the same as the stem. For example:
total. = 0
null = ""
total.null = total.null + 5
say total. total.null /* says "0 5" */
You can manipulate collections of variables, referred to by their stem, with the DROP and PROCEDURE
instructions. DROP FRED. drops all variables with that stem (see page “Purpose” on page 142), and
PROCEDURE EXPOSE FRED. exposes all possible variables with that stem (see page “Purpose” on page 155).
Notes:
1. When the ARG, PARSE, or PULL instruction or the VALUE built-in function or the variable pool
interface changes a variable, the effect is identical with an assignment. Anywhere a value can be
assigned, using a stem sets an entire collection of variables.
2. Because an expression can include the operator =, and an instruction may consist purely of an
expression (see section “Commands to External Environments”), a possible ambiguity is resolved by
the following rule: any clause that starts with a symbol and whose second token is (or starts with) an
equal sign (=)isanassignment, rather than an expression (or a keyword instruction). This is not a
restriction, because you can ensure the clause is processed as a command in several ways, such as
by putting a null string before the first name, or by enclosing the first part of the expression in
parentheses.
Similarly, if you unintentionally use a REXX keyword as the variable name in an assignment, this
should not cause confusion. For example, the clause:
Address='10 Downing Street';
is an assignment, not an ADDRESS instruction.
3. You can use the SYMBOL function (see page 193) to test whether a symbol has been assigned a
value. In addition, you can set SIGNAL ON NOVALUE to trap the use of any uninitialized variables
(except when they are tails in compound variables—see page 225).
Commands to External Environments
Issuing commands to the surrounding environment is an integral part of REXX.
Environment
The system under which REXX programs run is assumed to include at least one environment for
processing commands. An environment is selected by default on entry to a REXX program. You can
change the environment by using the ADDRESS instruction. You can find out the name of the current
environment by using the ADDRESS built-in function. The underlying operating system defines
environments external to the REXX program. The default environment for a REXX/CICS program is
REXXCICS.
Commands
To send a command to the currently addressed environment, use a clause of the form:
expression;
REXX General Concepts
124
CICS TS for VSE/ESA: REXX Guide