Relation Conditions

A relation condition specifies a comparison of two operands, each of which may be a data item or a literal. A relation condition has the value true if the relation exists between the operands. Comparison of two numeric operands is permitted regardless of the formats specified by their respective USAGE clauses. For all other comparisons, the operands must have the same USAGE.

The format of a relation condition is:

value1 IS [NOT]  { GREATER THAN            }  value2
                 { >                       }
                 { LESS THAN               }
                 { <                       }
                 { EQUAL TO                }
                 { =                       }
                 { <>                      }
                 { GREATER THAN OR EQUAL TO}
                 { >=                      }
                 { LESS THAN OR EQUAL TO   }
                 { <=                      }

In the preceding format, value1 and value2 may be either an arithmetic expression, a data name, or a literal (including NULL or NULLS). The relational operators have the following meanings:

Meaning Operators
Greater than IS GREATER THAN

IS >

IS NOT <=

IS NOT LESS THAN OR EQUAL TO

Equal to IS EQUAL TO

IS =

Less than IS LESS THAN

IS <

IS NOT >=

IS NOT GREATER THAN OR EQUAL TO

Greater than or equal IS NOT LESS THAN

IS NOT <

IS >=

IS GREATER THAN OR EQUAL TO

Not equal to IS NOT EQUAL TO

IS NOT =

IS <>

Less than or equal IS NOT GREATER THAN

IS NOT >

IS <=

IS LESS THAN OR EQUAL TO