COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-29
MAX Function
MAX Function
MAX is a function that returns the value of its maximum argument. Its type depends on
the type of its arguments, as this table shows:
argument
is an alphabetic, alphanumeric, integer, or numeric argument. If you specify more
than one argument, they must all be of the same class. Integer and numeric
arguments can be mixed, because integers are of the class numeric.
argument can be an array; for example,
FUNCTION MAX (ARRAY1(ALL))
returns the largest element of the array ARRAY1.
The returned value is the argument with the greatest value (according to the rules for
evaluating simple conditions). If the function type is alphanumeric, the size of the
returned value is the same as that of the argument with the greatest value. If two
arguments have the same greatest value, the value of the leftmost argument is
returned.
Argument Type Function Type
Alphabetic Alphanumeric
Alphanumeric Alphanumeric
Integer Integer
Numeric (some can be integer) Numeric
( )
MAXFUNCTION argument
VST439.vsd