A relation condition causes a comparison of two operands, each of which can be the data item referenced by an identifier, a literal or the value resulting from an arithmetic expression. A relation condition has a truth value of "true" if the relation exists between the operands. Comparison of two numeric operands is permitted regardless of the formats specified in their respective USAGE clauses. However, for all other comparisons the operands must have the same usage. If either of the operands is a group item, the nonnumeric comparison rules apply.
A nonnumeric literal can be enclosed in parentheses.
Note that " = TO", "> THAN" and "< THAN" are accepted.
THEN may be used instead of THAN.
The first operand (identifier-1, literal-1 or arithmetic-expression-1) is called the subject of the condition; the second operand (identifier-2 or literal-2 or arithmetic-expression-2) is called the object of the condition. The relation condition must contain at least one reference to a variable.
The relational operator specifies the type of comparison to be made in a relation condition. A space must precede and follow each reserved word comprising the relational operator. When used, "NOT" and the next key word or relation character are one relational operator that defines the comparison to be executed for truth value; for example, "NOT EQUAL" is a truth test for an "unequal" comparison; " NOT GREATER" is a truth test for an "equal" or "less" comparison. The meaning of the relational operators is shown in the Relational Operators table below.
The following relational operators are equivalent:
|IS EQUAL TO||and||EQUALS;|
|IS NOT EQUAL TO||and||IS UNEQUAL TO;|
|IS GREATER THAN||and||EXCEEDS;|
|IS NOT GREATER THAN||and||IS LESS THAN OR EQUAL TO;|
|IS NOT LESS THAN||and||IS GREATER THAN OR EQUAL TO.|
|Greater than or not greater than||
|Less than or not less than||
|Equal or not equal to||
|Greater than or equal to||
|Less than or equal to||
|Not equal to||
The required relational characters '<', '>', and '=' are not underlined to avoid confusion with other symbols such as '>' (greater than or equal to).