Merge Two SAV Files

May 4, 2012 at 12:28 PM

Merge Two SAV Files
Posted: May 04, 2012 08:17:20 AM


Click to report abuse...   Click to reply to this thread Reply
Hi All,

I'm using the SPSSIO.DLL in C# ( .NET wrapper in Visual Studio 2010). I am trying to create a merged SAV file from two earlier SAV files.

File #1 has about 10,000 cases and 5,000 variables.
File #2 has about 5,000 cases and 20,000 variables.
File #3 is the joined file & the respondents in File #2 are a subset of the respondents in File #1, but have answered more questions. There is also a linking ID which is common between the two files.

In summary, I am trying to create a "merged" file with 25,000 variables & 10,000 cases. I can create the database framework pretty easily, but populating the variables is taking FOREVER (I am currently iterating through each variable and assigning on a one-to-one basis for the entire database).

1) Assuming I have the merged file framework, is there an easy and QUICK way to:

a) Assign all of the File 1 values for each variable in a case into a new case with the same variable names in the new file
b) See which variables are null, so I won't do the assignment.

Thanks in advance,

May 4, 2012 at 3:32 PM

Hi Ian,

The best would be to use the SPSS itself for such a task (it can be automatized thru syntaxes) - I am afraid it is beyond the purpose of the spssio32 considering such an amount of data. Or I would rather create a data pump between SPSS and some SQL engine and do those transformations there.

Or you can try to use SPSS ODBC drivers and try to do the merging in Access.




Jul 1, 2012 at 3:08 PM


In the end I used the library, but created a custom index class in C# to point directly to the relevant case in the source SAV file.

Still takes about an hour to run, but it does work.