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 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!

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
  • 1 reply
  • 468 views
  • 0 likes
  • 2 in conversation