## Counting the number of obs based on soc sec num

Solved
Super Contributor
Posts: 286

# Counting the number of obs based on soc sec num

I have a data set sorted by social security number.  I want to use (I think) a proc summary with an OUT = option that reports the number of times each social security number appears in the data set.

Maybe something like

proc sort data=allsets;

by ssn;

proc summary data=allsets out=ssn_count;

var ssn.

Accepted Solutions
Solution
‎04-10-2015 01:41 PM
Super User
Posts: 23,689

## Re: Counting the number of obs based on soc sec num

Since it's a frequency count, perhaps use PROC FREQ instead?

proc freq data=allsets noprint;

table ssn/out=want;

run;

All Replies
Solution
‎04-10-2015 01:41 PM
Super User
Posts: 23,689

## Re: Counting the number of obs based on soc sec num

Since it's a frequency count, perhaps use PROC FREQ instead?

proc freq data=allsets noprint;

table ssn/out=want;

run;

Super Contributor
Posts: 286

## Re: Counting the number of obs based on soc sec num

Yes, perfect.  Thanks.

🔒 This topic is solved and locked.