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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1626 UPDATE<br />

BY Subcommand<br />

BY specifies one or more identification, or key, variables that are used to match cases<br />

between files.<br />

• BY must follow the FILE subcommands and any associated RENAME and IN subcommands.<br />

• BY specifies the names of one or more key variables. The key variables must exist in all<br />

input files and have the same names in all the files. The key variables can be string variables<br />

(long strings are allowed).<br />

• All input files must be sorted in ascending order of the key variables. If necessary, use<br />

SORT CASES before UPDATE.<br />

• Missing values for key variables are handled like any other values.<br />

• The key variables in the master file must identify unique cases. If duplicate cases are<br />

found, the program issues an error and UPDATE is not executed. The system-missing<br />

value is treated as one single value.<br />

RENAME Subcommand<br />

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

RENAME must follow the FILE subcommand that contains the variables to be renamed.<br />

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

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

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.

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

Saved successfully!

Ooh no, something went wrong!