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 quotes and be the same
case as in the data set. |
Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.