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 follows:
Argument Type
|
Function Type
|
Alphabetic
|
Alphanumeric
|
Alphanumeric
|
Alphanumeric
|
National
|
National
|
All arguments integer
|
Integer
|
Numeric
|
Numeric
|
(some arguments can be integer)
|
|
General Format
Arguments
- If more than one argument-1 is specified, all arguments must be of the same class except alphabetic and alphanumeric arguments
which can be mixed.
Returned Values
- 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 relation conditions. See the topic
Relation Condition in the chapter
Procedure Division.
- 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.
- If the type of the function is alphanumeric
or national
the size of the returned value is the same as the size of the selected argument-1.
- If the value of argument-1 is numeric non-integer, results are returned in floating-point format.