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.

82 ADD FILES<br />

• The resulting file contains complete dictionary information from the input files, including<br />

variable names, labels, print and write formats, and missing-value indicators. It also<br />

contains the documents from each input file. See DROP DOCUMENTS for information on<br />

deleting documents.<br />

• Variables are copied in order from the first file specified, then from the second file<br />

specified, and so on. Variables that are not contained in all files receive the systemmissing<br />

value for cases that do not have values for those variables.<br />

• If the same variable name exists in more than one file but the format type (numeric or<br />

string) does not match, the command is not executed.<br />

• If a numeric variable has the same name but different formats (for example, F8.0 and F8.2)<br />

in different input files, the format of the variable in the first-named file is used.<br />

• If a string variable has the same name but different formats (for example, A24 and A16)<br />

in different input files, the command is not executed.<br />

• If the working file is named as an input file, any N and SAMPLE commands that have been<br />

specified are applied to the working file before files are combined.<br />

• If only one of the files is weighted, the program turns weighting off when combining<br />

cases from the two files. To weight the cases, use the WEIGHT command again.<br />

Limitations<br />

Examples<br />

• Maximum 50 files can be combined on one ADD FILES command.<br />

• The TEMPORARY command cannot be in effect if the working data file is used as an<br />

input file.<br />

ADD FILES FILE=SCHOOL1 /FILE=SCHOOL2.<br />

• ADD FILES concatenates cases from the SPSS-format data files SCHOOL1 and SCHOOL2.<br />

All cases from SCHOOL1 precede all cases from SCHOOL2 in the resulting file.<br />

SORT CASES BY LOCATN DEPT.<br />

ADD FILES FILE=SOURCE /FILE=* /BY LOCATN DEPT<br />

/KEEP AVGHOUR AVGRAISE LOCATN DEPT SEX HOURLY RAISE /MAP.<br />

SAVE OUTFILE=PRSNNL.<br />

• SORT CASES sorts cases in the working file in ascending order of their values for LOCATN<br />

and DEPT.<br />

• ADD FILES combines two files: the SPSS-format data file SOURCE and the sorted working<br />

file. The file SOURCE must also be sorted by LOCATN and DEPT.<br />

• BY indicates that the keys for interleaving cases are LOCATN and DEPT, the same<br />

variables used on SORT CASES.<br />

• KEEP specifies the variables to be retained in the resulting file.<br />

• MAP produces a list of variables in the resulting file and the two input files.<br />

• SAVE saves the resulting file as a new SPSS-format data file named PRSNNL.

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

Saved successfully!

Ooh no, something went wrong!