IBM Support

MATCH FILES, ADD FILES commands create files with variables, no cases

Technote (FAQ)


I have used the Match Files command to merge 2 or more data files and run the command from a syntax window in SPSS Statistics. The resulting data set has the variables that are expected for the merged file, but there are no cases in that data set. Have I missed a step?


The MATCH FILES command and the ADD FILES command are transformation commands
and do not force a pass of the data. An EXECUTE command or a procedure command (e.g., a statistical procedure such as DESCRIPTIVES) must follow these commands for the cases to be filled in. Here is an example.

MATCH FILES FILE= 'C:\SPSS_datasets\demographic.sav'
/FILE= 'C:\SPSS_datasets\scores.sav'
/BY student

You can also force a data pass by opening the Transform menu and clicking Run Pending Transforms after running the MATCH FILES command.
When you arrange the merge from the Data->Merge Files menu and click OK, the data pass is performed so the cases are filled in. If you arrange the merge from that dialog and click paste, then the EXECUTE command is pasted after the MATCH FILES or ADD FILES command. (The STAR JOIN command is pasted if you open the Data->Merge Files->Add Variables dialog and check the box "Match cases on key variables" but do not check the box "Cases are sorted on key variables in both data sets". STAR JOIN does force a pass of the data without an EXECUTE command.)

Related information

Need more help? Our Statistics forum is Live!

Document information

More support for: SPSS Statistics

Software version: Not Applicable

Operating system(s): Platform Independent

Reference #: 1653846

Modified date: 07 September 2016