BookmarkSubscribeRSS Feed
brywhi11
Calcite | Level 5

I'm trying to use the rank function in SAS but I'm not sure I'm using it correctly or there may be another function that works better.

The data I have is made up of storm names and states associated with each storm. I have run a formula showing me by storm which states have the largest percentage of records i.e.

Storm 1:

KS = 60%

MO = 15%

IL = 10%

OH = 6%

AR = 5%

TX = 2%

KY = 2%

Is there a way to rank (by storm) the states that have the largest % of records?

1 REPLY 1
ballardw
Super User

How have you tried so far?

You may only need to 1) sort by storm and 2) include a BY storm statement in Proc Rank;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 768 views
  • 0 likes
  • 2 in conversation