Subsetting Data

Deleting Unwanted Observations

So far in this chapter, you've learned to use IF-THEN statements to execute assignment statements conditionally. But you can specify any executable SAS statement in an IF-THEN statement. For example, you can use an IF-THEN statement with a DELETE statement to determine which observations to omit as you read data.
  • The IF-THEN statement executes a SAS statement when the condition in the IF clause is true.
  • The DELETE statement stops the processing of the current observation.
General form, DELETE statement:
DELETE;
To conditionally execute a DELETE statement, you submit a statement in the following general form:
IF expression THEN DELETE;
If the expression is
  • true, the ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition 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.