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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.