I have a dataset that has 55 variables, all answering one question: 'what degree have you obtained?' Each row represents a student, and the 55 columns are from different points in time, for example: degree obtained Jan 2009, degree obtained Feb 2009, etc. Most of these 55 columns are blank, at most a student has 5 valid column entrees (ranging anywhere from certificate to Ph.d.). I would like to combine these into 5 variables, labeled degree1 to degree5. I can't figure out a way to do this.
I have tried a do repeat command:
STRING DEGREE1 TO DEGREE5 (A25).
COMPUTE DEGREE1 = DEGREE_TITLE.1.
DO REPEAT X = DEGREE_TITLE.2 TO DEGREE_TITLE.55.
IF (DEGREE1 = ' ') DEGREE1 = X.
Obviously, I only get the first entry. I am stuck as to what to do next. Any ideas?