IBM SC34-5764-01 Server User Manual


 
Rather than writing multiple instructions every time you want to find the maximum of a group of three
numbers, you can use a built-in function that does the calculation for you and returns the maximum
number. The function is called MAX, and you can use it as follows:
MAX(number1,number2,number3,....)
To find the maximum of 45, -2, number, and 199 and put the maximum into the symbol biggest, write the
following instruction:
biggest = MAX(45,-2,number,199)
Built-In Functions
More than 50 functions are built into the language processor. The built-in functions fall into the following
categories:
v Arithmetic functions
Evaluate numbers from the argument and return a particular value.
v Comparison functions
Compare numbers, or strings, or both and return a value.
v Conversion functions
Convert one type of data representation to another type of data representation.
v Formatting functions
Manipulate the characters and spacing in strings supplied in the argument.
v String manipulating functions
Analyze a string supplied in the argument (or a variable representing a string) and return a particular
value.
v Miscellaneous functions
Do not clearly fit into any of the other categories.
The following tables briefly describe the functions in each category. For a complete description of these
functions, see Chapter 14, “Functions,” on page 171.
/***************************** REXX **********************************/
/* This program receives three numbers as arguments and analyzes */
/* which number is the greatest. */
/*********************************************************************/
PARSE ARG number1, number2, number3 .
IF number1 > number2 THEN
IF number1 > number3 THEN
greatest = number1
ELSE
greatest = number3
ELSE
IF number2 > number3 THEN
greatest = number2
ELSE
greatest = number3
RETURN greatest
Figure 27. Finding a Maximum Number
Using Functions
52
CICS TS for VSE/ESA: REXX Guide