Previous Page | Next Page

Statements

DELETE Statement



Stops processing the current observation.
Valid: in a DATA step
Category: Action
Type: Executable

Syntax
Without Arguments
Details
Comparisons
Examples
Example 1: Using the DELETE Statement as Part of an IF-THEN Statement
Example 2: Using the DELETE Statement to Subset Raw Data
See Also

Syntax

DELETE;


Without Arguments

When DELETE executes, the current observation is not written to a data set, and SAS returns immediately to the beginning of the DATA step for the next iteration.


Details

The DELETE statement is often used in a THEN clause of an IF-THEN statement or as part of a conditionally executed DO group.


Comparisons


Examples


Example 1: Using the DELETE Statement as Part of an IF-THEN Statement

When the value of LEAFWT is missing, the current observation is deleted:

if leafwt=. then delete;


Example 2: Using the DELETE Statement to Subset Raw Data

data topsales;
   infile file-specification;
   input region office product yrsales;
   if yrsales<100000 then delete;
run;


See Also

Statements:

DO Statement

DROP Statement

IF Statement, Subsetting

IF-THEN/ELSE Statement

Previous Page | Next Page | Top of Page