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.

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

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