ORD Function [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
ORD Function
The ORD function returns an integer value that is the ordinal position of
parameter-1 in the collating sequence for the program. The lowest
ordinal position is 1. The function type is integer.
Syntax
FUNCTION ORD (parameter-1)
Parameters
parameter-1 Must be one character in length and must be class
alphabetic or alphanumeric.
Return Value
The returned value is the ordinal position of parameter-1 in the
collating sequence for the program.
Example
77 NUM PIC 999 VALUE ZERO.
:
COMPUTE NUM = FUNCTION ORD ("A").
DISPLAY NUM.
The above example displays the following:
066
MPE/iX 5.0 Documentation