Date: Wed, 1 Sep 2010 09:15:56 -0600
Reply-To: Jon K Peck <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Jon K Peck <email@example.com>
Subject: Re: Copying variable attributes
Take a look at APPLY DICTIONARY. Probably the easiest way would be to do
one massive rename so that the variables match up, and then you can copy
selected properties keyed by the matching names.
SPSS, an IBM Company
Mike Pritchard <firstname.lastname@example.org>
09/01/2010 08:54 AM
[SPSSX-L] Copying variable attributes
"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
I think I'm looking for a way to copy variable attributes to other in
bulk. But it is probably a good idea to explain the background in case
the list members have better ideas on how to tackle my problem.
I've got one SPSS file as an export from my survey tool - call it File A.
The file has fairly good labels and value labels but the variable names
are just the internal variable names from the tool (which has regressed in
this respect from previous versions). This file is also incomplete
because something in my survey is breaking the export, so the support
people created a file for me manually while the problem is being
The second SPSS file (File B) was created from Excel from a CSV export
from the survey tool with the complete set of responses. This has good
variable names, but of course no labels or values.
To add a little more complexity, the files don't exactly match in the
variables or attributes. There are some differences in the reference
variables at the beginning that are easily handled. Some variables from
the original questionnaire aren't present in the Excel file (I think just
because nobody chose that option); some variables are strings in File B
with the Other included but separate variables in File A; File A has
checkbox variables as 0 or 1 while File B has them coded as the option
number. These are things that can be handled with recoding.
The reason I don't want to just do this manually is that there are 121
variables for each of 10 categories, plus a few others. Apart from the
time and tedium, it is pretty error prone, so the more I can automate the
better. Right now I'm copying variable labels and values from File A to
File B, and then adjusting for the differences.
Any suggestions would be most appreciated.