With SPSS 14 you can use the new programmability extension to identify all string variables and the AUTORECODE command to convert the strings to numeric. AUTORECODE automatically retains the original variable and value labels.
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of D. Michaels
Sent: Tuesday, February 07, 2006 1:06 PM
Subject: Convert many STRING vars to NUMERIC while keeping labels
I was wondering if anyone has had any success converting all STRING vars
in a file to NUMERIC format while retaining the value labels and variable
labels after the conversion. I am hoping that there is some simply
solution as a "destring" command, but I'm certain this doesn't exist (from
what I've reviewed).
I am attempting this conversion on a file which contains both string and
numeric variables (approx. 1000 variables in total). I've had some
success using various macros from spsstools.net including the varlist
macro and a macro which converts ALL string variables between 2 given
variables in the data file.
A combination of the two macros accomplishes a portion of the task, but
does not retain the variable or value lables. As well, the macros seem
to work fine on a small set of variables, but seems to freeze when running
it on the entire file. I'm using SPSS 14.0 on a new P4 system with 2 gig
of memory which should be sufficient for the task.
Any help or suggestions would be GREATLY appreciated.