IBM SC34-5764-01 Server User Manual


 
decimal point. If you specify n, it must be a positive whole number or zero. The number is first rounded
according to standard REXX rules, just as though the operation number+0 had been carried out. The
number is then truncated to n decimal places (or trailing zeros are added if needed to make up the
specified length). The result is never in exponential form.
Here are some examples:
TRUNC(12.3) -> 12
TRUNC(127.09782,3) -> 127.097
TRUNC(127.1,3) -> 127.100
TRUNC(127,2) -> 127.00
Note: The number is rounded according to the current setting of NUMERIC DIGITS if necessary before
the function processes it.
USERID
 USERID() 
returns the CICS signon user ID if the user is signed onto CICS or the CICS region default user ID (if one
was specified by the CICS systems programmer). User IDs are padded on the right with blanks so that the
returned value is always eight bytes long.
Here is an example:
USERID() -> 'ARTHUR' /* Maybe */
VALUE
 VALUE(name
,
newvalue ,selector
) 
returns the value of the symbol that name (often constructed dynamically) represents and optionally
assigns it a new value. By default, VALUE refers to the current REXX-variables environment, however, if
you want to specify selector the value must be RLS. If the selector of RLS is specified, then the variable
operated on is a REXX List System (RLS) variable, rather than a REXX variable. If you use the function to
refer to REXX variables, then name must be a valid REXX symbol. (You can confirm this by using the
SYMBOL function.) Lowercase characters in name are translated to uppercase. Substitution in a
compound name (see section “Compound Symbols” on page 122) occurs if possible.
If you specify newvalue, then the named variable is assigned this new value. This does not affect the
result returned; that is, the function returns the value of name as it was before the new assignment.
Here are some examples:
/* After: Drop A3; A33=7; K=3; fred='K'; list.5='Hi' */
VALUE('a'k) -> 'A3' /* looks up A3 */
VALUE('a'k||k) -> '7' /* looks up A33 */
VALUE('fred') -> 'K' /* looks up FRED */
VALUE(fred) -> '3' /* looks up K */
VALUE(fred,5) -> '3' /* looks up K and */
/* then sets K=5 */
VALUE(fred) -> '5' /* looks up K */
VALUE('LIST.'k) -> 'Hi' /* looks up LIST.5 */
The following example returns the VALUE of the REXX variable FRED that has been stored in an RLS
variable.
Functions
196
CICS TS for VSE/ESA: REXX Guide