Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ORD-MIN - Ordinal position of minimum argument

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

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

  2. argument-1 may not be of the class "object“ or "pointer".

Returned values

  1. The returned value is the ordinal number that indicates the position of the argument having the last value in the argument series.

  2. The comparisons used to determine the least valued argument are made according to the rules for simple conditions (see section "Conditions").

  3. If more than one argument has the same least value, the number returned corresponds to the position of the leftmost argument having that value.

  4. 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.