The ORD-MIN function returns an integer value that indicates which of the specified arguments, seen from left to right, contains the minimum value.
The type of this function is integer.
Format
FUNCTION
ORD-MIN
({argument-1}...)
Arguments
If more than one argument is specified, all arguments must be of the same class.
argument-1 may not be of the class "object“ or "pointer".
Returned values
The returned value is the ordinal number that indicates the position of the argument having the last value in the argument series.
The comparisons used to determine the least valued argument are made according to the rules for simple conditions (see section "Conditions").
If more than one argument has the same least value, the number returned corresponds to the position of the leftmost argument having that value.
The error default value is 0.
See also: ORD-MAX, MAX, MIN
Example 9-35
... DATA DIVISION. WORKING-STORAGE SECTION. 01 R PIC 9(3). PROCEDURE DIVISION. P1 SECTION. MAIN. COMPUTE R = FUNCTION ORD-MIN ("Z" "3" "B" "?" "a"). DISPLAY R UPON T. STOP RUN.
Result: 004
The fourth argument ("?") has the least value.