COBOL Manual for TNS/E Programs (H06.03+)
Procedure Division
HP COBOL Manual for TNS/E Programs—520347-003
8-55
Simple Conditions
•
Operators
The relational operators specify the type of comparison to be made in the relation
condition, as this table shows. NOT and the component following it are considered
to be a single relational operator. For example, NOT EQUAL is a truth test for an
unequal comparison. In this table, optional words are in brackets.
•
Numeric Comparisons
Numeric comparisons are made with respect to the algebraic values of the
operands. The number of digits present in the representation of an operand is not
significant. Comparison of numeric operands is permitted regardless of the manner
in which their usage is described. Unsigned numeric operands are considered
positive for purposes of comparison. Zero is considered a unique value regardless
of its sign.
•
Nonnumeric Comparisons
For nonnumeric operands, or one numeric and one nonnumeric operand, a
comparison is made with respect to the program collating sequence (see OBJECT-
COMPUTER Paragraph).
°
One operand is numeric:
°
The numeric operand must be a numeric literal or a reference to a numeric
data item; therefore, it cannot be an arithmetic expression. COBOL
requires the operand to be an integer and, if a data item, to have DISPLAY
usage. HP COBOL removes both of these restrictions.
Relational Operator
MeaningWords Symbol
GREATER [THAN] > Greater than
NOT GREATER [THAN] NOT > Not greater than
LESS [THAN] < Less than
NOT LESS [THAN] NOT < Not less than
EQUAL [TO] = Equal to
NOT EQUAL [TO] NOT = Not equal to
GREATER [THAN] OR EQUAL [TO] >= Greater than or equal to
LESS [THAN] OR EQUAL [TO] <= Less than or equal to










