[code:2fp4qiu7]data freq ;
do i=1 to 12;
output;
end;
run;
data Top10;
set freq end=last;
if _N_<=9 then COUNT=i;
if _N_>9 then COUNT+i;
if _N_<=9 then output;
if last then output;
run;[/code:2fp4qiu7]
[code:34o2kgqe]data ex ex2;
do a=1 to 12;
output;
end;
run;
data ex2(drop=count);
set ex(firstobs=10) end=last;
if _N_>=1 then do;
count+a;
end;
a=count;
if last then output;
run;
data ex3;
set ex(obs=9) ex2;
run;[/code:34o2kgqe]