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.

SAVE TRANSLATE 1469<br />

RETAIN Retain the unselected cases. All cases in the working data file are saved. This<br />

is the default when UNSELECTED is specified by itself.<br />

DELETE Delete the unselected cases. Only cases that meet the FILTER or USE criteria<br />

are saved in the SPSS-format data file.<br />

DROP and KEEP Subcommands<br />

Use DROP or KEEP to include only a subset of variables in the resulting file. DROP specifies<br />

a set of variables to exclude. KEEP specifies a set of variables to retain. Variables not specified<br />

on KEEP are dropped.<br />

• Specify a list of variable, column, or field names separated by commas or spaces.<br />

• KEEP does not affect the order of variables in the resulting file. Variables are kept in their<br />

original order.<br />

• Specifying a variable that is not in the working data file or that has been dropped because<br />

of a previous DROP or KEEP subcommand results in an error and the SAVE command is<br />

not executed.<br />

Example<br />

SAVE TRANSLATE OUTFILE=’ADDRESS.DBF’ /TYPE=DB4 /DROP=PHONENO, ENTRY.<br />

• SAVE TRANSLATE creates a dBASE IV file named ADDRESS.DBF, dropping the variables<br />

PHONENO and ENTRY.<br />

RENAME Subcommand<br />

RENAME changes the names of variables as they are copied into the resulting file.<br />

• The specification on RENAME is a list of old variable names followed by an equals sign<br />

and a list of new variable names. The same number of variables must be specified on both<br />

lists. The keyword TO can be used in the first list to refer to consecutive variables in the<br />

working data file and in the second list to generate new variable names (see “Keyword<br />

TO” on p. 23 in Volume I). The entire specification must be enclosed in parentheses.<br />

• Alternatively, you can specify each old variable name individually, followed by an equals<br />

sign and the new variable name. Multiple sets of variable specifications are allowed. The<br />

parentheses around each set of specifications are optional.<br />

• RENAME does not affect the working data file. However, if RENAME precedes DROP or<br />

KEEP, variables must be referred to by their new names on DROP or KEEP.<br />

• Old variable names do not need to be specified according to their order in the working<br />

data file.<br />

• Name changes take place in one operation. Therefore, variable names can be exchanged<br />

between two variables.<br />

• Multiple RENAME subcommands are allowed.

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

Saved successfully!

Ooh no, something went wrong!