counting number of firms and missing values

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

counting number of firms and missing values

Hi I am trying to get a feel for my data and the number of unique observations

I am wanting to

  1. count the number of firms (the variable is called cusip).
  2. count the number of firm names (the variable is called firms)

Any help is appreciated


Accepted Solutions
Solution
‎10-21-2013 12:26 AM
Trusted Advisor
Posts: 1,137

Re: counting number of firms and missing values

Posted in reply to wschnell1

Please try,

proc sql;

     select count(distinct cusip) as count_cusip, count(distinct firms) as count_firms from data;

quit;

Thanks,

jagadish

Thanks,
Jag

View solution in original post


All Replies
Solution
‎10-21-2013 12:26 AM
Trusted Advisor
Posts: 1,137

Re: counting number of firms and missing values

Posted in reply to wschnell1

Please try,

proc sql;

     select count(distinct cusip) as count_cusip, count(distinct firms) as count_firms from data;

quit;

Thanks,

jagadish

Thanks,
Jag
Respected Advisor
Posts: 4,173

Re: counting number of firms and missing values

Posted in reply to wschnell1

PROC FREQ and PROC UNIVARIATE are two very useful procedures when it comes to data exploration.

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 507 views
  • 4 likes
  • 3 in conversation