DROP and KEEP Subcommands (EXPORT command)
DROP
and KEEP
save a subset of variables in the portable
file.
-
DROP
excludes a variable or list of variables from the portable file. All variables not named are included in the portable file. -
KEEP
includes a variable or list of variables in the portable file. All variables not named are excluded. - Variables can be specified on
DROP
andKEEP
in any order. With theDROP
subcommand, the order of variables in the portable file is the same as their order in the active dataset. With theKEEP
subcommand, the order of variables in the portable file is the order in which they are named onKEEP
. Thus,KEEP
can be used to reorder variables in the portable file. - Both
DROP
andKEEP
can be used on the sameEXPORT
command; the effect is cumulative. If you specify a variable already named on a previousDROP
or 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.