BookmarkSubscribeRSS Feed
rb688
Calcite | Level 5

 

Please let me know how to get largest top 5 name of States and smallest bottom States as comparing to India in above or attached data. 

3 REPLIES 3
rb688
Calcite | Level 5

your reply not matched with the query. Pls understand the question??

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Your question has been asked many times, you may need to do some alteration based on your specific data, however the question is no different.  Here for instance shows you a sort+datastep example.

https://communities.sas.com/t5/General-SAS-Programming/how-to-select-top-100-observation-a-variable-...

Here shows another version:

https://communities.sas.com/t5/SAS-Programming/Need-to-Filter-Top-10-records-from-multiple-groups-af...

Another showing proc rank:

https://communities.sas.com/t5/SAS-Programming/Top-5-by-observations-per-each-county/m-p/423333/high...

 

If you would like actual code, please present test data in the form of a datastep:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

And show what you would like out from that.

 

 

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1197 views
  • 0 likes
  • 2 in conversation