Chapter Contents |
Previous |
Next |
WHERE= |
Valid in: | DATA step and PROC steps |
Category: | Observation Control |
Restriction: | Cannot be used with the FIRSTOBS= and OBS= data set options or with the POINT= option in the SET and MODIFY statements. |
Syntax | |
Syntax Description | |
Details | |
Comparisons | |
Examples | |
Example 1: Selecting Observations from an Input Data Set | |
Example 2: Selecting Observations from an Output Data Set | |
See Also |
Syntax |
WHERE=(where-expression) |
Details |
You can also select observations that are written to an output data set. In general, selecting observations at the point of input is more efficient than selecting them at the point of output; however, there are some cases when selecting observations at the point of input is not practical or not possible.
Note: Using indexed SAS data sets can improve performance
significantly when you are using WHERE expressions to access a subset of the
observations in a SAS data set. See "SAS Indexes" in "SAS
Data Files" in
SAS Language Reference: Concepts for a complete discussion of WHERE expression processing with indexed
data sets and a list of guidelines to consider before indexing your SAS data
sets.
Comparisons |
Examples |
This example uses the WHERE= data set option to subset the SALES data set as it is read into another data set:
data whizmo; set sales(where=(product='whizmo')); run;
This example uses the WHERE= data set option to subset the SALES output data set:
data whizmo(where=(product='whizmo')); set sales; run;
See Also |
Statements:
| |||
"WHERE Processing" in SAS Language Reference: Concepts |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.