Relation Condition

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.

OSVSVSC2 A nonnumeric literal can be enclosed in parentheses.

OSVS Note that " = TO", "> THAN" and "< THAN" are accepted.

OSVSMF 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.
Table 1. Relational Operators
Meaning Relational Operator
Greater than or not greater than  
{short description of image}
Less than or not less than  
{short description of image}
Equal or not equal to  
{short description of image}
Greater than or equal to  
{short description of image}
Less than or equal to  
{short description of image}
Equal to  
{short description of image}
Not equal to  
{short description of image}
Greater than  
{short description of image}

The required relational characters '<', '>', and '=' are not underlined to avoid confusion with other symbols such as '>'  (greater than or equal to).