COBOL Manual for TNS and TNS/R Programs
Procedure Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
8-54
Simple Conditions
Relation Conditions in General
A relation condition causes a comparison of two operands. The relation condition has a
truth value of TRUE if the relation exists between the operands; otherwise, it has a
truth value of FALSE.
Usage Considerations:
•
Terminology
In the preceding syntax diagrams, the left-hand operand is called the subject of the
condition; the right-hand operand is called the object of the condition.
•
Where Pointer Relations Are Allowed
A relation with pointer operands is allowed in EVALUATE, IF, PERFORM, and
SEARCH VARYING statements. It is not allowed in SEARCH ALL statements,
because pointer data items have no meaningful order.
•
Cannot Compare Literal With Literal
At least one nonpointer operand must be an index-name, identifier, or arithmetic
expression containing at least one reference to a data item; that is, the relation
must include at least one nonliteral element.
•
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.
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