@avishek2411: I think you have the right idea. But the data step after proc sort can be simplified greatly by have a SET and BY statement inside a DO UNTIL (LAST.ID) loop:
data temp;
input id zip cntr $;
cards;
1234 30004 USD
1234 30012 USD
1289 30056 USD
1389 45009 INR
1456 56789 INR
1456 30067 USD
1567 30099 USD
1567 67890 GBP
1567 30088 INR
1567 30092 INR
;
proc sort data=temp(drop=zip) out=temp1 nodupkey;
by id cntr;
run;
data want;
do until (last.id);
set temp1;
by id;
length cntr_list $20;
cntr_list=catx(',',cntr_list,cntr);
end;
drop cntr;
run;
The only downside is that the currency list for each id is alphabetic. It is no longer in the order of appearance. Have to ask @sahaji whether that is meaningful deficiency.
... View more