consolidating multiple text variables

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

HOLAMON
Posts: 1
Joined: Mon Apr 24, 2017 7:12 pm

consolidating multiple text variables

Postby HOLAMON » Mon Apr 24, 2017 7:25 pm

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.
EXE.
DO REPEAT X = DEGREE_TITLE.2 TO DEGREE_TITLE.55.
IF (DEGREE1 = ' ') DEGREE1 = X.
END REPEAT.

Obviously, I only get the first entry. I am stuck as to what to do next. Any ideas?
heather94
Posts: 1
Joined: Wed Jun 14, 2017 3:43 pm

Re: consolidating multiple text variables

Postby heather94 » Wed Jun 14, 2017 4:09 pm

Did you ever get a solution? I have a simiar issue. I have
column 1 column2 column3
Dr
Dr
Dr
Dr

and want to combine the three columns into one.

Can you offer any advice?
Heather

Who is online

Users browsing this forum: No registered users and 2 guests

cron