27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

910 MATCH FILES<br />

RENAME Subcommand<br />

RENAME renames variables on the input files before they are processed by MATCH FILES.<br />

RENAME must follow the FILE or TABLE subcommand that contains the variables to be<br />

renamed.<br />

• RENAME applies only to the immediately preceding FILE or TABLE subcommand. To<br />

rename variables from more than one input file, specify a RENAME subcommand after<br />

each FILE or TABLE subcommand.<br />

• Specifications for RENAME consist of a left parenthesis, a list of old variable names, an<br />

equals sign, a list of new variable names, and a right parenthesis. The two variable lists<br />

must name or imply the same number of variables. If only one variable is renamed, the<br />

parentheses are optional.<br />

• More than one rename specification can be specified on a single RENAME subcommand,<br />

each enclosed in parentheses.<br />

• The TO keyword can be used to refer to consecutive variables in the file and to generate<br />

new variable names. (See the TO keyword on p. 23 in Volume I.)<br />

• RENAME takes effect immediately. Any KEEP and DROP subcommands entered prior to<br />

a RENAME must use the old names, while KEEP and DROP subcommands entered after a<br />

RENAME must use the new names.<br />

• All specifications within a single set of parentheses take effect simultaneously. For<br />

example, the specification RENAME (A,B = B,A) swaps the names of the two variables.<br />

• Variables cannot be renamed to scratch variables.<br />

• Input SPSS-format data files are not changed on disk; only the copy of the file being<br />

combined is affected.<br />

Example<br />

MATCH FILES FILE=UPDATE /RENAME=(NEWID = ID)<br />

/FILE=MASTER /BY ID.<br />

• MATCH FILES matches a master SPSS-format data file (MASTER) with an update data file<br />

(UPDATE).<br />

• Variable NEWID in the UPDATE file is renamed ID so that it will have the same name as<br />

the identification variable in the master file and can be used on the BY subcommand.<br />

DROP and KEEP Subcommands<br />

DROP and KEEP are used to include a subset of variables in the new working data file. DROP<br />

specifies a set of variables to exclude and KEEP specifies a set of variables to retain.<br />

• DROP and KEEP do not affect the input files on disk.<br />

• DROP and KEEP must follow all FILE, TABLE, and RENAME subcommands.<br />

• DROP and KEEP must specify one or more variables. If RENAME is used to rename variables,<br />

specify the new names on DROP and KEEP.<br />

• The keyword ALL can be specified on KEEP. ALL must be the last specification on KEEP,<br />

and it refers to all variables not previously named on KEEP.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!