I'm using SPSS 20.
In my dataset is a list of string variables which I want to recoded into numeric. Originally I wanted them to be recoded into themselves.
I realize that this is not possible as SPSS runs through the dataset casewise and one variable can only have one type at a time.
So I want them to be recoded into new variables but with the suffix _rec.
DO REPEAT var = var_1 var_2 ... var_n.
RECODE var (CONVERT) INTO var_rec.
END REPEAT.
But this creates only one new variable var_rec not several new ones.
I also tried to programme a workaround:
COMPUTE Job_2
STRING Job(A20)
DO REPEAT var = var_1 var_2 ... var_n.
COMPUTE var = Job.
RECODE Job (CONVERT) INTO Job_2.
DELETE VARIABLES var.
COMPUTE var = Job_2.
END REPEAT.
But this doesn't work because DELETE VARIABLES can not be used within a DO REPEAT loop.
So I'm back at my original question.