data have;
input ID Variable $;
cards;
1 X
2 X
3 Y
4 X
;
proc sql;
create table want as
select variable, count(variable)as count
from have
group by variable;
quit;
Catch up on SAS Innovate 2026
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.