Built-in Functions

REXX provides a rich set of built-in functions, including character manipulation, conversion, and information functions.

Other built-in and external functions are generally available—see section External Functions Provided in REXX/CICS.

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. Any argument named as a number is rounded, if necessary, according to the current setting of NUMERIC DIGITS (just as though the number had been added to 0) and checked for validity before use. This occurs in the following functions: ABS, FORMAT, MAX, MIN, SIGN, and TRUNC, and for certain options of DATATYPE. 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 stated.
  • 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. You can include any number of trailing commas; they are ignored. (Where there are actual parameters, the default values apply.)
  • 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.

Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/dfhrxap.html