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.

84 ADD FILES<br />

• Input data files are not changed on disk; only the copy of the file being combined is affected.<br />

Example<br />

ADD FILES FILE=CLIENTS /RENAME=(TEL_NO, ID_NO = PHONE, ID)<br />

/FILE=MASTER /BY ID.<br />

• ADD FILES adds new client cases from the file CLIENTS to existing client cases in the file<br />

MASTER.<br />

• Two variables on CLIENTS are renamed prior to the match. TEL_NO is renamed PHONE<br />

to match the name used for phone numbers in the master file. ID_NO is renamed ID so that<br />

it will have the same name as the identification variable in the master file and can be used<br />

on the BY subcommand.<br />

• The BY subcommand orders the resulting file according to client ID number.<br />

BY Subcommand<br />

BY specifies one or more key variables that determine the order of cases in the resulting file.<br />

When BY is specified, cases from the input files are interleaved according to their values for<br />

the key variables.<br />

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

• The key variables specified on BY must be present and have the same names in all input files.<br />

• Key variables can be long or short string variables or numerics.<br />

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

SORT CASES before ADD FILES.<br />

• Cases in the resulting file are ordered by the values of the key variables. All cases from<br />

the first file with the first value for the key variable are first, followed by all cases from<br />

the second file with the same value, followed by all cases from the third file with the same<br />

value, and so forth. These cases are followed by all cases from the first file with the next<br />

value for the key variable, and so on.<br />

• Cases with system-missing values are first in the resulting file. User-missing values are<br />

interleaved with other values.<br />

DROP and KEEP Subcommands<br />

DROP and KEEP are used to include only a subset of variables in the resulting file. DROP<br />

specifies a set of variables to exclude and KEEP specifies a set of variables to retain.<br />

• DROP and KEEP do not affect the input files on disk.<br />

• DROP and KEEP must follow all FILE and RENAME subcommands.<br />

• DROP and KEEP must specify one or more variables. If RENAME is used to rename<br />

variables, specify the new names on DROP and KEEP.<br />

• DROP and KEEP take effect immediately. If a variable specified on DROP or KEEP does<br />

not exist in the input files, was dropped by a previous DROP subcommand, or was not<br />

retained by a previous KEEP subcommand, the program displays an error message and<br />

does not execute the ADD FILES command.

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

Saved successfully!

Ooh no, something went wrong!