Reading and Concatenating SAS Data Sets |
Selecting Observations
|
In the previous practice, you created a data set identical
to Stress2. But you usually don't want an exact duplicate
of the existing data set.
For example, suppose you want to process only observations where the value
for maximum heart rate ( To select only those observations that meet a specified condition, you can use a subsetting IF statement in any DATA step. |
General form, subsetting IF statement:
IF expression; where expression is any valid SAS expression.
|
For example, the subsetting IF statement below selects only
observations whose values for Placebo are YES. |
data lab23.drug1h; set research.cltrials; if placebo='YES'; run; |
Because the variable Placebo is a character
variable, the value YES must be enclosed in quotation marks and
be the same case as in the data set. |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.