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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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