data test;
input schname $ sch $;
cards;
小学A 小学
小学B 小学
小学A 小学
小学D 小学
小学C 小学
小学D 小学
中学B 中学
中学C 中学
中学C 中学
中学C 中学
中学B 中学
中学X 中学
中学B 中学
中学X 中学
中学B 中学
;
run;
proc sql;
select distinct schname, count(schname) as count,sch
from test
group by schname;
quit;
try this and below:
proc freq data=test;
table schname*sch;
run;