-
Use the WHERE= data set option
with an input data set to select rows that meet the condition specified
in the WHERE expression before SAS brings them into the DATA or PROC
step for processing. Selecting rows that meet the conditions of the
WHERE expression is the first operation SAS performs in each iteration
of the DATA step.
You can also select
rows that are written to an output data set. In general, selecting
rows at the point of input is more efficient than selecting them at
the point of output. However, there are some cases when selecting
rows at the point of input is not practical or not possible.
-
You can apply OBS= and FIRSTOBS=
processing to WHERE processing.
-
You cannot use the WHERE= data
set option with the POINT= option in the SET and MODIFY statements.
-
If you use both the WHERE= data
set option and the WHERE statement in the same DATA step, SAS ignores
the WHERE statement for data sets with the WHERE= data set option.
However, you can use the WHERE= data set option with the WHERE command
in
SAS/FSP software.
Note: Using indexed SAS data sets
can improve performance significantly when you are using WHERE expressions
to access a subset of the rows in a SAS data set.