data have;
infile datalines dsd;
input Place $ Customer $ Type $;
datalines;
IL,Alex,Gold
FL,Mike,Gold
IL,Mie,Gold
IL,Prince,Silver
FL,Troy,Silver
run;
proc sql;
create table want as
select Place,Type,count(*) as count
from have
group by Place,Type;
quit;
proc summary data=have nway;
class Place CustomerType;
output out=want(drop=_type_ rename=(_freq_=count));
run;
or proc tabulate:
proc tabulate data=have;
class CustomerType Place;
table Place, CustomerType*n;
run;
Register Today!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.