Chapter Contents

Previous

Next
KEEP

KEEP



Includes variables in output SAS data sets

Valid: With LENGTH= 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=
Statements:
DROP
IF, Subsetting
RETAIN


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.