SYSTEM 2000 and SAS treat nulls differently when processing
where-clause conditions. SYSTEM 2000 assumes that a null is outside the domain of values for an
item. Therefore, the only way to qualify a null is by using the FAILS operator. In
fact, for any relational operator in an item-to-item
condition, SYSTEM 2000 never qualifies a record in which either of the items is null. Even
if the condition is C1* = C2* and both items are null, the record does not qualify.
For example, if item C2 is null in some data records, the following item-to-item condition
never qualifies those records, regardless of the respective values:
WHERE C1* > C2*
In contrast, SAS assumes
that nulls are equal to each other. In SAS, nulls
-
for numeric variables are indicated
by periods
-
for character variables are indicated
by blanks
When SAS processes a condition such as C1 >= C2, the qualified records include every
record in which C2 is null,
regardless of the value of C1. Also, the condition C1 = C2 qualifies records that
have nulls for both C1 and C2, in addition to records in which C1 and C2 have equal
values that are not null.
Because of these different treatments, it is important to know whether SAS or SYSTEM
2000 is processing a where-clause. The where-clause in a view descriptor is never
seen by SAS and is processed by SYSTEM 2000. However, the WHERE clause associated
with a SAS procedure, the DATA step, or a SELECT statement in the SQL procedure can
be processed partly by both SAS and SYSTEM 2000 if individual conditions are meaningful
to SYSTEM 2000.
Because missing values are different, a condition in a WHERE clause in SAS that uses
the period (.) notation is never seen by SYSTEM
2000. SAS performs the qualification for such conditions. For more information, see
WHERE Clauses in SAS and where-clauses in SYSTEM 2000.