HP 3000 Manuals

ORD-MIN Function [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

ORD-MIN Function 

The ORD-MIN function returns a value that is the ordinal number of the
argument that contains the minimum value.  The function type is integer.

Syntax 

     FUNCTION ORD-MIN ({parameter-1}...)

Parameters 

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

Return Value 

The returned value is the ordinal number that corresponds to the position
of the parameter-1 having the least value in the parameter-1 series.

The comparisons used to determine the least valued parameter-1 are made
according to the rules for simple conditions.  See the section "Simple
Conditions" in Chapter 8  for additional information.

If more than one parameter-1 has the same least value, the number
returned corresponds to the positions of the leftmost parameter-1 having
that value.

Example 

     77  NUM     PIC 999 VALUE ZERO.
          :
     COMPUTE NUM = FUNCTION ORD-MIN ("M", "C", "Z", "A", "M").
     DISPLAY NUM.

The above example displays the following.  The least value is "A", which
is in the fourth position:

     004



MPE/iX 5.0 Documentation