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.

IMPORT 769<br />

• DROP excludes a variable or list of variables from the working data file. All variables not<br />

named are included in the file.<br />

• KEEP includes a variable or list of variables in the working file. All variables not specified<br />

on KEEP are excluded.<br />

• DROP and KEEP cannot precede the FILE or TYPE subcommands.<br />

• Variables can be specified in any order. The order of variables on KEEP determines the<br />

order of variables in the working file. The order on DROP does not affect the order of variables<br />

in the working file.<br />

• If a variable is referred to twice on the same subcommand, only the first mention is<br />

recognized.<br />

• Multiple DROP and KEEP subcommands are allowed; the effect is cumulative. Specifying<br />

a variable named on a previous DROP or not named on a previous KEEP results in an error<br />

and the command is not executed.<br />

• The keyword TO can be used to specify a group of consecutive variables in the portable<br />

file.<br />

• The portable file is not affected by DROP or KEEP.<br />

Example<br />

IMPORT FILE=NEWSUM /DROP=DEPT TO DIVISION.<br />

• The working data file is generated from the portable file NEWSUM. Variables between and<br />

including DEPT and DIVISION in the portable file are excluded from the working file.<br />

• All other variables are copied into the working file.<br />

RENAME Subcommand<br />

RENAME renames variables being read from the portable file. The renamed variables retain<br />

the variable and value labels, missing-value flags, and print formats contained in the portable<br />

file.<br />

• To rename a variable, specify the name of the variable in the portable file, a required<br />

equals sign, and the new name.<br />

• A variable list can be specified on both sides of the equals sign. The number of variables on<br />

both sides must be the same, and the entire specification must be enclosed in parentheses.<br />

• The keyword TO can be used for both variable lists (see “Keyword TO” on p. 23).<br />

• Any DROP or KEEP subcommand after RENAME must use the new variable names.<br />

Example<br />

IMPORT FILE=NEWSUM /DROP=DEPT TO DIVISION<br />

/RENAME=(NAME,WAGE=LNAME,SALARY).<br />

• RENAME renames NAME and WAGE to LNAME and SALARY.<br />

• LNAME and SALARY retain the variable and value labels, missing-value flags, and print<br />

formats assigned to NAME and WAGE.

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

Saved successfully!

Ooh no, something went wrong!