Search code examples
databasespss

Dealing with SPSS labels when exporting to a database


Working on a project to export SPSS survey data files to a MySQL database. While the actual import via ODBC is fine, I'm running into a dilemma of how to deal with the labels in the data. For example, my SPSS files for each question have a number as the data that corresponds to a descriptive label for that variable.

I want to be able to save both values, the number choice and the answer options into a database - is there a way to link just the two, or am I going to need to make some much more complicated database tables and relationships to hold everything.


Solution

  • I think you are referring to value labels vs values. Normally it is the values that would be exported. You could export label sets to different database tables and link them via SQL.

    A simpler solution would be to create for each variable whose labels you want to preserve a parallel variable with the labels. To do this, use something like string x_label(a120). compute x_label = valuelabel(x).

    You can put this logic in a DO REPEAT with vectors if you have a lot of these variables.

    HTH, Jon Peck