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
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.