data test;
input ID a b c d@@;
cards;
1 10 30 10 20
1 10 10 10 15
2 15 20 10 10
3 10 15 15 15
3 20 15 20 10
3 10 15 20 10
4 15 20 15 15
4 10 10 15 15
5 20 10 30 10
;
run;
proc sql;
select b, count(b) as count
from
(select distinct ID,b
from test)
group by b
;
quit;