You could use DO REPEAT and scratch variables. Something like (untested).
VECTOR YearVar_(7,A20).
DO REPEAT C = countriesin2010 TO countriesin2016
/Y = YearVar_1 TO YearVar_7.
COMPUTE #Split = CHAR.INDEX(C,',').
COMPUTE Y = CHAR.SUBSTR(C,1,#Split-1).
END REPEAT.
Then use RENAME VARIABLES if you want your YearVar_ vector to be a nicer set
of names corresponding to each year.
Another way depending on your data flow would be to use VARSTOCASES on
'countriesin2010' -- 'countriesin2016', so all of the year variables are in
one column instead of in separate rows.
-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/--
Sent from:
http://spssx-discussion.1045642.n5.nabble.com/=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD