Examples (ADD FILES command)

ADD FILES FILE="/data/school1.sav" 
         /FILE="/data/school2.sav".
  • ADD FILES concatenates cases from the IBM® SPSS® Statistics data files school1.sav and school2.sav. All cases from school1.sav precede all cases from school2.sav in the resulting file.
    SORT CASES BY LOCATN DEPT.
    ADD FILES  FILE="/data/source.sav" /FILE=* /BY LOCATN DEPT
     /KEEP AVGHOUR AVGRAISE LOCATN DEPT SEX HOURLY RAISE /MAP.
    SAVE OUTFILE="/data/prsnnl.sav".
  • SORT CASES sorts cases in the active dataset in ascending order of their values for LOCATN and DEPT.
  • ADD FILES combines two files: the external IBM SPSS Statistics data file source.sav and the sorted active dataset. The file source.sav must also be sorted by LOCATN and DEPT.
  • BY indicates that the keys for interleaving cases are LOCATN and DEPT, the same variables used on SORT CASES.
  • KEEP specifies the variables to be retained in the resulting file.
  • MAP produces a list of variables in the resulting file and the two input files.
  • SAVE saves the resulting file as a new IBM SPSS Statistics data file named prsnnl.sav.