data m;
input a x;
cards;
1 1
1 3
1 5
1 2
2 7
2 4
2 3
2 6
2 9
;
proc sql;
create table m as
select *, count(x) as sum
from m;
quit;
data m;
set m;
length group $10.;
pctn=_n_/sum;
if pctn<=0.2 then group='20%';
else if 0.2<pctn<=0.4 then group='20-40%';
else if 0.4<pctn<=0.6 then group='40-60%';
else if 0.6<pctn<=0.8 then group='60-80%';
else if 0.8<pctn then group='>80%';
run;
proc tabulate data=m;
class a group;
table group,a*(n pctn);
run;