Chapter Contents

Previous

Next
KEEP=

KEEP=



Specifies variables for processing or for writing to output SAS data sets

Valid in: DATA step and PROC steps
Category: Variable Control


Syntax
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

KEEP=variable(s)

Syntax Description

variable(s)
lists one or more variable names. You can list the variables in any form that SAS allows.


Details

If the KEEP= data set option is associated with an input data set, only those variables that are listed after the KEEP= data set option are available for processing. If the KEEP= data set option is associated with an output data set, only the variables listed after the option are written to the output data set, but all variables are available for processing.


Comparisons


Examples

In this example, only IDNUM and SALARY are read from PAYROLL, and they are the only variables in PAYROLL that are available for processing:

data bonus;
   set payroll(keep=idnum salary);
   bonus=salary*1.1;
run;

See Also

Data Set Options:

KEEP=

Statements:

KEEP


Chapter Contents

Previous

Next

Top of Page

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