RENAME Subcommand (MATCH FILES command)
RENAME renames
variables on the input files before they are processed by MATCH FILES. RENAME must follow the FILE or TABLE subcommand that contains the variables to be renamed.
-
RENAMEapplies only to the immediately precedingFILEorTABLEsubcommand. To rename variables from more than one input file, specify aRENAMEsubcommand after eachFILEorTABLEsubcommand. - Specifications for
RENAMEconsist of a left parenthesis, a list of old variable names, an equals sign, a list of new variable names, and a right parenthesis. The two variable lists must name or imply the same number of variables. If only one variable is renamed, the parentheses are optional. - More than one rename specification can be specified
on a single
RENAMEsubcommand, each enclosed in parentheses. - The
TOkeyword can be used to refer to consecutive variables in the file and to generate new variable names. -
RENAMEtakes effect immediately. AnyKEEPandDROPsubcommands entered prior to aRENAMEmust use the old names, whileKEEPandDROPsubcommands entered after aRENAMEmust use the new names. - All specifications within a single set of parentheses
take effect simultaneously. For example, the specification
RENAME (A,B = B,A)swaps the names of the two variables. - Variables cannot be renamed to scratch variables.
Example
MATCH FILES FILE='/data/update.sav'
/RENAME=(NEWID = ID)
/FILE='/data/primary.sav'
/BY ID.
-
MATCH FILESmatches a primary IBM® SPSS® Statistics data file (primary.sav) with an update data file (update.sav). - The variable NEWID in the update.sav file is renamed ID so that it will
have the same name as the identification variable in the primary file and can be used on the
BYsubcommand.