IBM SC34-5764-01 Server User Manual


 
/* REXX EXEC - ASSIGN FIND VALUE OF FRED */
FRED = 7
'RLS VARPUT FRED \USERS\userid\'
X = VALUE(FRED,,RLS)
SAY X
/*Xnow=7 */
Notes:
1. If the VALUE function refers to an uninitialized REXX variable then the default value of the variable is
always returned; the NOVALUE condition is not raised. A reference to RLS variables never raises
NOVALUE.
2. If you specify the name as a single literal string and omit newvalue and selector, the symbol is a
constant and so the string between the quotation marks can usually replace the whole function call.
(For example, fred=VALUE('k'); is identical with the assignment fred=k;, unless the NOVALUE
condition is being trapped. See Chapter 17, “Conditions and Condition Traps,” on page 225.)
VERIFY
 VERIFY(string,reference
,
option ,start
) 
returns a number that, by default, indicates whether string is composed only of characters from reference;
returns 0 if all characters in string are in reference, or returns the position of the first character in string not
in reference.
The option can be either Nomatch (the default) or Match. (Only the capitalized and highlighted letter is
needed. All characters following it are ignored, and it can be in upper- or lowercase, as usual.) If you
specify Match, the function returns the position of the first character in string that is in reference, or returns
0 if none of the characters are found.
The default for start is 1; thus, the search starts at the first character of string. You can override this by
specifying a different start point, which must be a positive whole number.
If string is null, the function returns 0, regardless of the value of the third argument. Similarly, if start is
greater than LENGTH(string), the function returns 0.Ifreference is null, the function returns 0 if you specify
Match; otherwise the function returns the start value.
Here are some examples:
VERIFY('123','1234567890') -> 0
VERIFY('1Z3','1234567890') -> 2
VERIFY('AB4T','1234567890') -> 1
VERIFY('AB4T','1234567890','M') -> 3
VERIFY('AB4T','1234567890','N') -> 1
VERIFY('1P3Q4','1234567890',,3) -> 4
VERIFY('123','',N,2) -> 2
VERIFY('ABCDE','',,3) -> 3
VERIFY('AB3CD5','1234567890','M',4) -> 6
WORD
 WORD(string,n) 
returns the nth blank-delimited word in string or returns the null string if fewer than n words are in string.
The n must be a positive whole number. This function is exactly equivalent to SUBWORD(string,n,1).
Here are some examples:
WORD('Now is the time',3) -> 'the'
WORD('Now is the time',5) -> ''
Functions
Chapter 14. Functions 197