I have used proc rank 'group=5'. Based on the 'varrank', how do i sort the data such that each table lists 'CY' variables under each rank per dsname grouping?
i.e. i have data from work.yr16 to yr20.
Thank you for the assistance!
Please post more of your data and what you want the result to look like.
Makes it much easier to help you.
And we always ask people to post data in usable form. Pictures are NOT usable.
Post your data as code, in a data step with datalines.
proc rank data=iglib.mktcap6yrs groups=5
out=rankedME;
by dsname;
var CY;
ranks varrank;
run;
apologies, here are the codes
Please supply dataset
mktcap6yrs
in a data step with datalines.
I'm not sure how to convert the data into datalines. i have a few hundred datalines.
My third footnote links to a macro that converts datasets to data step code.
A simple data step for your dataset will look like this:
data mktcap6yrs;
length
reits $8
cy 8
dsname $41
me_group 8
;
input
reits
cy
dsname
me_group
;
datalines;
AAREIT 834849900 WORK.YR16 1
;
Add additional datalines as needed to illustrate your task.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.