MrTaco
MrTaco

Reputation: 7

Merging and appending data on SPSS

I am collecting data on cspro and export it to spss and I want append new data on to the old data, so I won't have the same files that I worked on on my last data.

Is there any syntax to sort that out?

Upvotes: 2

Views: 1140

Answers (1)

eli-k
eli-k

Reputation: 11310

If you are looking for a way to add up two SPSS files (after exporting your new data to a new file), the syntax is:

add files 
   /file="path1/filename1.sav" 
   /file="path2/filename2.sav".

you may have trouble if the same string variables have different widths in the two files. If so you need to choose the appropriate width and force it on all relevant variables before adding the files:

get file="path1/filename1.sav".
alter type stringVar1 (a50) stringVar2 (a150).
dataset name fil1.
get file="path2/filename2.sav".
alter type stringVar1 (a50) stringVar2 (a150).
dataset name fil2.
add files /file=fil1 /file=fil2.
execute.

Upvotes: 2

Related Questions