Help using Base SAS procedures

Counting the number of obs based on soc sec num

Accepted Solution Solved
Reply
Super Contributor
Posts: 268
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: 17,784

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: 17,784

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

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

Yes, perfect.  Thanks.

☑ This topic is SOLVED.

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

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