Help using Base SAS procedures

Counting the number of obs based on soc sec num

Accepted Solution Solved
Reply
Super Contributor
Posts: 279
Accepted Solution

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.

...<not sure about the rest>


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

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;

View solution in original post


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

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: 279

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

Yes, perfect.  Thanks.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 187 views
  • 0 likes
  • 2 in conversation