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.

ADD FILES 81<br />

Variable Names. You can rename variables in each input file before combining the files using<br />

the RENAME subcommand. This permits you to combine variables that are the same but<br />

whose names differ in different input files, or to separate variables that are different but have<br />

the same name.<br />

Variable Flag. You can create a variable that indicates whether a case came from a particular<br />

input file using IN. When interleaving cases, you can use the FIRST or LAST subcommands<br />

to create a variable that flags the first or last case of a group of cases with the same value for<br />

the key variable.<br />

Variable Map. You can request a map showing all variables in the new working file, their<br />

order, and the input files from which they came using the MAP subcommand.<br />

Basic Specification<br />

• The basic specification is two or more FILE subcommands, each of which specifies a file<br />

to be combined. If cases are to be interleaved, the BY subcommand specifying the key<br />

variables is also required.<br />

• All variables from all input files are included in the new working file unless DROP or<br />

KEEP is specified.<br />

Subcommand Order<br />

• RENAME and IN must immediately follow the FILE subcommand to which they apply.<br />

• BY, FIRST, and LAST must follow all FILE subcommands and their associated RENAME<br />

and IN subcommands.<br />

<strong>Syntax</strong> Rules<br />

• RENAME can be repeated after each FILE subcommand. RENAME applies only to variables<br />

in the file named on the FILE subcommand immediately preceding it.<br />

• BY can be specified only once. However, multiple key variables can be specified on BY.<br />

When BY is used, all files must be sorted in ascending order by the key variables (see<br />

SORT CASES).<br />

• FIRST and LAST can be used only when files are interleaved (when BY is used).<br />

• MAP can be repeated as often as desired.<br />

Operations<br />

• ADD FILES reads all input files named on FILE and builds a new working data file that replaces<br />

any working file created earlier in the session. ADD FILES is executed when the<br />

data are read by one of the procedure commands or the EXECUTE, SAVE, or SORT CASES<br />

commands.

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

Saved successfully!

Ooh no, something went wrong!