Hi, I am trying to get the below list to show with each ID only once with all multiple rows of strings combined From: code string 1 a 1 b 2 e 3 g 3 h 4 i 5 k 5 l 5 m The code I am using to get the initial data is data work.blah;
infile datalines missover;
input ID $ string $;
datalines;
1 a
1 b
2 e
3 g
3 h
4 i
5 k
5 l
5 m
; To: code list 1 a, b 2 e 3 g, h 4 i 5 k, l, m The code I am using is data strings; length list $100.; set work.blah end=eof; retain list; if n=1 then list=string; else list = cats(list,", ",string); if eof then output; run; Unfortunately the result I am getting is list ID string n ,a,b,e,g,h,i,k,l,m 5 m . My questions are: 1) How can I get the unique IDs, and not just the last one (5) 2) How can I get the first string to start and not the ", " 3) How can I drop the 'string' and 'n' columns For reference I am using SAS EG 6.1 M1
... View more