@melassiri wrote: I don't think so, because there are other columns that have to piggyback without change.
Why would that matter? When you expand the comma separated list into multiple observations they will all have the exact same values for the "other" variables. So when you collapse them again (if you ever need to) there is no problem.
Of course it is easiest if the there is a simple BY variable (or perhaps a couple) that uniquely identify the original observations. Of course you can always add one while you expand to multiple observations.
data tall;
id+1;
set have;
do i=1 to max(1,countw(A,','));
value = strip(scan(A,i,', '));
output;
end;
drop i ;
run;
proc sort data=tall nodupkey out=want;
by id value;
run;
data want;
do until(last.id);
set want;
by id;
length B $100;
b = catx(',',b,value);
end;
drop value;
run;
... View more