hi, I have a data file something like this,
policynumber name
3 Jon
4 Alex
3 Jon
5 Tim
3 Jon
i want to count how many number of policies each individual has, can anyone please help me in this
Hi, or other PROCS ...
proc means data=x n nonobs;
class name;
run;
proc freq data=x;
table name;
run;
There are a few different ways of doing this - you could do something like
proc sql;
create table polcount
as select name, count(name) as totalpols
from have
group by name;
quit;
Thank you, can i use that code in SAS?
You certainly can - if it fits the bill could you mark my reply as an accepted solution please? It saves others from responding to an issue which has already been solved.
Hi, or other PROCS ...
proc means data=x n nonobs;
class name;
run;
proc freq data=x;
table name;
run;
thank you i got it
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.