Subsetting Data

Using a Subsetting IF Statement

The subsetting IF statement causes the DATA step to continue processing only those observations that meet the condition of the expression specified in the IF statement. The resulting SAS data set or data sets contain a subset of the original external file or SAS data set.
Syntax, subsetting IF statement:
IF expression;
expression is any valid SAS expression.
  • If the expression is true, the DATA step continues to process that observation.
  • If the expression is false, no further statements are processed for that observation, and control returns to the top of the DATA step.

Example: Subsetting IF Statement

The subsetting IF statement below selects only observations whose ...

Get SAS Certified Specialist Prep Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.