ILE COBOL Language Reference


MIN

The MIN function returns the content of the argument that contains the minimum value.

The function type depends on the argument types, as follows:

Argument Type Function Type
Alphabetic Alphanumeric
Alphanumeric Alphanumeric
National National
Index Index
All arguments integer Integer
Numeric (some arguments can be integer) Numeric
Format
 
                    .------------.
                    V            |
>>-FUNCTION MIN--(----argument-1-+--)--------------------------><
 
 
argument-1
Can be class numeric, alphanumeric, alphabetic, or DBCS, and cannot be class boolean.

If more than one argument-1 is specified, the combination of alphabetic and alphanumeric arguments is allowed. Other combinations of argument types are not allowed. For example DBCS arguments can not be mixed with alphanumeric arguments.

The returned value is the content of argument-1 having the least value. The comparisons used to determine the least value are made according to the rules for simple conditions. For more information, see Conditional Expressions.

If more than one argument-1 has the same least value, the leftmost argument-1 having that value is returned.

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

Related Information


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]