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) 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.
/* 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.
/* REXX EXEC - ASSIGN FIND VALUE OF FRED */
FRED = 7
'RLS VARPUT FRED \USERS\userid\'
X = VALUE(FRED,,RLS)
SAY X
/* X now = 7 */