Previous Page | Next Page

Statements

KEEP Statement



Specifies the variables to include in output SAS data sets.
Valid: in a DATA step
Category: Information
Type: Declarative

Syntax
Arguments
Details
Comparisons
Examples
See Also

Syntax

KEEP variable-list;


Arguments

variable-list

specifies the names of the variables to write to the output data set.

Tip: List the variables in any form that SAS allows.

Details

The KEEP statement causes a DATA step to write only the variables that you specify to one or more SAS data sets. The KEEP statement applies to all SAS data sets that are created within the same DATA step and can appear anywhere in the step. If no KEEP or DROP statement appears, all data sets that are created in the DATA step contain all variables.

Note:   Do not use both the KEEP and DROP statements within the same DATA step.  [cautionend]


Comparisons


Examples


See Also

Data Set Option:

KEEP= Data Set Option

Statements:

DROP Statement

IF Statement, Subsetting

RETAIN Statement

Previous Page | Next Page | Top of Page