ContentsIndexPreviousNext

MAX Function

The MAX function returns the content of the argument-1 that contains the maximum value. The type of this function depends upon the argument types as follow:

Argument Type
Function Type
Alphabetic
Alphanumeric
Alphanumeric
Alphanumeric
All arguments integer
Integer
Numeric (some arguments may be integer)
Numeric

Usage

FUNCTION MAX ({argument-1} ... )

Parameters

If more than one argument-1 is specified, all arguments must be of the same class.

Returned Values

1. The returned value is the content of the argument-1 having the greatest value. The comparisons used to determine the greatest value are made according to the rules for simple conditions.

2. If more than one argument-1 has the same greatest value, the content of the argument-1 returned is the leftmost argument-1 having that value.

3. If the type of the function is alphanumeric, the size of the returned value is the same as the size to the selected argument-1.