not
Type

Comparison Operator
Purpose

The not operator reverses the meaning of any comparison operator it precedes (e.g., STATE not = (equals) " NY" means any state except New York).

Syntax

VALUE 1 not comparison operator VALUE 2

Usage

The not operator's effect can often be accomplished by stating the comparison in a different way. For example, < (less than) can be substituted for not >= (not equal or greater than). Whenever possible, comparisons should be stated as a positive expression.

Examples

TOTAL DUE not > 500 ;

means the value in the TOTAL DUE field is less than or equal to 500.



STATE not = "NY" and STATE not = "NJ" ;

means any state except New York or New Jersey.


Caution

When you combine two or more comparisons using the not operator, you must use and in the comparison. If you use or in conjunction with not, as shown below, every record in the file is processed.



STATE not = "NY" or STATE not = "NJ" ;



In this example, records that do not meet one condition will meet the other condition.