BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Radwan
Quartz | Level 8

Hello 

I need to know how many companies in my sample , what the code that i can use ?

because my data is obtained from database in the meantime i removed some companies , missing value as well , so i need to know the final statistic.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Use the code provided, replace company with variable name, and have with your dataset - nethier of which you have mentioned, nor provided any test data in the form of a datastep, nor what the output should look like, so I can do nothing further.

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

No idea what the question is here?  Do you have a dataset with a variable with company name in, all standardised?  If so then:

proc sql;
  select count(distinct company) from have;
quit; 

Will print count of distinct company variable from dataset have, to log.  Just guessing though as you have provide no information in your question!!

Radwan
Quartz | Level 8
yes i have the dataset file which has code of companies not the name 

i wanna know how many firms i have it in my final sample.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Use the code provided, replace company with variable name, and have with your dataset - nethier of which you have mentioned, nor provided any test data in the form of a datastep, nor what the output should look like, so I can do nothing further.

Radwan
Quartz | Level 8
thank you
it works

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1466 views
  • 1 like
  • 2 in conversation