Chapter Contents |
Previous |
Next |
KEEP |
Valid: | With LENGTH= in a DATA step |
Category: | Information |
Type: | Declarative |
Syntax | |
Arguments | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
KEEP variable-list; |
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.
Comparisons |
Examples |
keep name address city state zip phone;
keep rep1-rep5;
data average; keep name avg; infile file-specification; input name $ score1-score20; avg=mean(of score1-score20); run;
See Also |
Data Set Option:
| |||||||
Statements:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.