mingfeng07 发表于 2014-7-25 18:09 
you could leverage function catx as below. catt function is very useful and convenient.
data a;
input id @@;
cards;
1 2 3
;
run;
data b;
set a;
length new_id $10;
new_id=put(id,1.);
do i=1 to 1+_n_;
new_id=catx(',',new_id,id);
end;
run;