SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3

Deletes an observation from a SAS data set

Valid: in a DATA step

Category: Action

Type: Executable

Restriction: Use only with a MODIFY statement.

Syntax

REMOVE < data-set- name (s) >;

Without Arguments

If you specify no argument, the REMOVE statement deletes the current observation from all data sets that are named in the DATA statement.

Arguments

data-set-name

Details

The deletion of an observation can be physical or logical, depending on the engine that maintains the data set. Using REMOVE overrides the default replacement of observations. If a DATA step contains a REMOVE statement, you must explicitly program all output for the step.

Comparisons

Examples

This example removes one observation from a SAS data set.

libname perm ' SAS-data-library '; data perm.accounts; input AcctNumber Credit; datalines; 1001 1500 1002 4900 1003 3000 ; data perm.accounts; modify perm.accounts; if AcctNumber=1002 then remove; run; proc print data=perm.accounts; title 'Edited Data Set'; run;

Here are the results of the PROC PRINT statement:

Edited Data Set 1 Acct OBS Number Credit 1 1001 1500 3 1003 3000

See Also

Statements:

Категории