DROP and KEEP Subcommands (EXPORT command)
DROP and KEEP save a subset of variables in the portable
file.
-
DROPexcludes a variable or list of variables from the portable file. All variables not named are included in the portable file. -
KEEPincludes a variable or list of variables in the portable file. All variables not named are excluded. - Variables can be specified on
DROPandKEEPin any order. With theDROPsubcommand, the order of variables in the portable file is the same as their order in the active dataset. With theKEEPsubcommand, the order of variables in the portable file is the order in which they are named onKEEP. Thus,KEEPcan be used to reorder variables in the portable file. - Both
DROPandKEEPcan be used on the sameEXPORTcommand; the effect is cumulative. If you specify a variable already named on a previousDROPor one not named on a previousKEEP, the variable is considered nonexistent and the program displays an error message. The command is aborted and no portable file is saved.
Example
EXPORT OUTFILE=NEWSUM /DROP=DEPT TO DIVISION.
- The portable file is written to file NEWSUM. Variables between and including DEPT and DIVISION in the active dataset are excluded from the portable file.
- All other variables are saved in the portable file.