REXX provides a rich set of built-in functions, including character manipulation,
conversion, and information functions.
There are six other built-in functions that TSO/E provides: EXTERNALS,
FIND, INDEX, JUSTIFY, LINESIZE, and USERID. If you plan to write REXX
programs that run on other SAA environments, note that these functions are
not available to all the environments. In this section, these six
built-in functions are identified as non-SAA functions.
In addition to the built-in functions, TSO/E also provides TSO/E
external functions that you can use to perform different tasks. These
functions are described in TSO/E external functions
The following are general notes on the built-in functions:
- The parentheses in a function are always needed, even if no arguments
are required. The first parenthesis must follow the name of the function
with no space in between.
- The built-in functions work internally with NUMERIC DIGITS 9 and
NUMERIC FUZZ 0 and are unaffected by changes to the NUMERIC settings,
except where stated. This is not true for RANDOM.
- Any argument named as a string may be
a null string.
- If an argument specifies a length, it
must be a positive whole number or zero. If it specifies a start character
or word in a string, it must be a positive whole number, unless otherwise
- Where the last argument is optional, you can always include a
comma to indicate you have omitted it; for example, DATATYPE(1,),
like DATATYPE(1), would return NUM.
- If you specify a pad character, it must
be exactly one character long. (A pad character extends a string,
usually on the right. For
an example, see the LEFT built-in function on page LEFT.)
- If a function has an option you can
select by specifying the first character of a string, that character
can be in upper- or lowercase.
- A number of the functions described in this chapter support DBCS.
A complete list and descriptions of these functions are in Double-byte character set (DBCS) support.