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.

FILE Subcommand<br />

ADD FILES 83<br />

FILE identifies the files to be combined. A separate FILE subcommand must be used for each<br />

input file.<br />

• An asterisk may be specified on FILE to indicate the working data file.<br />

• The order in which files are named determines the order of cases in the resulting file.<br />

Raw Data Files<br />

To add cases from a raw data file, you must first define the file as the working data file using<br />

the DATA LIST command. ADD FILES can then combine the working file with an SPSS-format<br />

data file.<br />

Example<br />

DATA LIST FILE=GASDATA/1 OZONE 10-12 CO 20-22 SULFUR 30-32.<br />

ADD FILES FILE=PARTICLE /FILE=*.<br />

SAVE OUTFILE=POLLUTE.<br />

• The GASDATA file is a raw data file and is defined on the DATA LIST command.<br />

• The PARTICLE file is a previously saved SPSS-format data file.<br />

• FILE=* on ADD FILES specifies the working data file, which contains the gas data.<br />

FILE=PARTICLE specifies the SPSS-format data file PARTICLE.<br />

• SAVE saves the resulting file as an SPSS-format data file with the filename POLLUTE.<br />

Cases from the GASDATA file follow cases from the PARTICLE file.<br />

RENAME Subcommand<br />

RENAME renames variables in input files before they are processed by ADD FILES. RENAME<br />

follows the FILE subcommand that specifies the file containing the variables to be renamed.<br />

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

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

that specifies a file with variables to be renamed.<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 such specification can be entered on a single RENAME subcommand, each<br />

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 “Keyword TO” on p. 23).<br />

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

must use the old names, while those entered after 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.

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

Saved successfully!

Ooh no, something went wrong!