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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 861 views
  • 0 likes
  • 2 in conversation