data have;
infile cards expandtabs truncover;
input obs a b ;
cards;
1 10 1
2 20 2
3 10 1
4 20 3
5 10 1
6 20 2
7 10 3
8 20 3
9 10 2
10 20 4
11 10 4
12 20 2
;
run;
proc sql;
create table want as
select b,count(*) as count,sum(a) as sum
from have
group by b
having calculated sum gt 45 ;
quit;
... View more