Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

SCREEN COBOL Source Program
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
2-20
Simple Conditions
Relation Condition
A relation condition causes a comparison of two values. Each value can be a data item,
a literal, or a value resulting from an arithmetic computation; both values cannot be
literals. A relation condition has a truth value of true if the relation exists between the
values.
Relation condition syntax is:
The relational operators <, =, > (less than, equal to, greater than) determine the type of
comparison made. A space must precede and follow each word of the relational
operator. When NOT is included, the word NOT and the next keyword or relation
character are one operator. NOT EQUAL is a truth test for an unequal comparison;
NOT GREATER is a truth test for an equal or less comparison.
Two numeric values can be compared regardless of their usage (as defined by a USAGE
clause). For all other comparisons, however, the values must have the same usage. If
either of the values is a group item, nonnumeric comparison rules apply.
Comparison of Numeric Operands
Comparison of numeric operands is made with respect to the algebraic value of the
operands. The length of the literal or arithmetic expression operands, in terms of the
number of digits represented, is not significant. Zero is considered a unique value
regardless of the sign.
Comparison of these operands is permitted regardless of the manner in which their usage
is described. Unsigned numeric operands are considered positive.
Comparison of Nonnumeric Operands
Comparison of nonnumeric operands, or one numeric and one nonnumeric operand, is
made with respect to the ASCII collating sequence of characters. The size of an operand
is its total number of characters.
A noninteger numeric operand cannot be compared to a nonnumeric operand.
Numeric and nonnumeric operands can be compared only when their usage is the same.
The following conventions apply:
The numeric operand must be an integer data item or an integer literal.
If the nonnumeric operand is an elementary data item or a nonnumeric literal, the
numeric operand is treated as though it were moved to an elementary alphanumeric
value-1 IS { [ NOT ] { LESS [ THAN ] } } value-2
{ { < } }
{ }
{ [ NOT ] { EQUAL [ TO ] } }
{ { = } }
{ }
{ [ NOT ] { GREATER [ THAN ] } }
{ { > } }