UPDATE

so i thought i had found the answer, however the syntax below only works when there is no missing data in the variables. if there is missing data it removes the case from the file. i.e. if 6 cases and one with missing response, it creates a new variable with only 5 cases. does anyone know what can be done to make the syntax work and preserve record of which cases are missing data?

ORIGINAL QUESTION

I have an spss datafile which separated responses from two groups of participants on the same survey question into two variables in SPSS (i.e. Variable 1 = Males responses to question 1, and Variable 2 = Females responses to question 1). Does anyone know of syntax I can use in SPSS to merge these two variables into one variable in SPSS so that the new variable, e.g. Question 1, would contain the responses from both males and females?

I could sort by gender (i have this variable) and then cut and paste the data but am reluctant to do this as it introduces possibility of human error and is not so easily replicable (prefer to have the syntax as evidence of what was done)

Thanks,

Nicola

for example, data looks like:

Similar questions and discussions