DROP and KEEP Subcommands (VARSTOCASES command)
The DROP and KEEP subcommands are used to include only
a subset of variables in the new active dataset. The DROP subcommand specifies a set of variables
to exclude and the KEEP subcommand
specifies a set of variables to retain. Variables not specified on
the KEEP subcommand are dropped.
-
DROPandKEEPcannot be used with variables that appear on aFROMlist. -
DROPandKEEPare mutually exclusive. Only oneDROPor oneKEEPsubcommand can be used on theVARSTOCASEScommand. -
KEEPaffects the order of variables in the new data file. The order of the variables kept in the new data file is the order in which they are named on theKEEPsubcommand.
Example
VARSTOCASES
/MAKE newvar FROM var1 to var4
/DROP caseid.
- Caseid is dropped from the new data file. The new data file contains one variable, newvar.