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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.