In SPSS, how do I concatenate files?

In SPSS, use the ADD FILES command to concatenate or append two or more data files. The files must be SPSS system files. To concatenate them simply, list the files to be merged using the /FILE subcommand. The concatenation follows the order of the files specified.

This first example adds three files called PART1.sav, PART2.sav, and PART3.sav in the c:\spssdata directory:

  ADD FILES
    /FILE="C:\spssdata\PART1.sav"
    /FILE="C:\spssdata\PART2.sav"
    /FILE="C:\spssdata\PART3.sav".
  EXECUTE.

You can also index the files on a specific variable (such as case ID) if you wish; this is called interleaving files. The files are organized on the variable ID, so that the final saved data set is indexed according to this shared variable. Notice that the order of the files read into SPSS is reversed, but the final product is the same due to the /BY subcommand.

  ADD FILES
    /FILE="C:\spssdata\PART3.sav"
    /FILE="C:\spssdata\PART2.sav"
    /FILE="C:\spssdata\PART1.sav"
    /BY=ID.
  EXECUTE.

If you have questions about using statistical and mathematical software at Indiana University, contact Research Analytics. Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200; staff are available for consultation Monday-Friday 9am-noon and by appointment.

Note:
For details about availability of UITS services during winter break, see UITS winter break support hours.

This is document aeqq in the Knowledge Base.
Last modified on 2015-06-19 00:00:00.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.