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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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