data temp ;
input ID $ val source 8;
datalines;
V1 0 1
V1 10 1
V1 100 2
V1 250 2
V2 50 1
V2 80 1
V2 500 2
V7 10 1
V7 20 1
V7 30 2
V7 99 2
;
run;
I need to create two seperate columns that comma delimit the values. Based on the above table I need the following result.
ID GOOD BAD
V1 '0, 10' '100,250'
V2 '50,80' '500'
V7 '10.20' '30,99'
This is the code I have so far
data temp2 ;
set temp ;
by id ;
retain arr_good ;
length arr_good $ 50;
arr_good=ifc( first.id,val,cats(arr_good,',',val));
if last.id then output;
run;
But this code puts all the rows for each id in one column. I can't figure out how to check for the source to split it up into two separate columns.
Thank You
... View more