Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b]SAS equivalent to MS Excel RANK function[/b]

Status
Not open for further replies.

Starbury

Programmer
Sep 11, 2007
6
US
Is there a SAS equivalent to the RANK function in MS Excel>
 
Well, that does it for me, but I want put the results back into the data step.

GOAL:
Var A is 613 unique observations.
Var B is a the rank of the Var A
Var C = 490th highest value of Var A
Var D = If Var B<=410th highest value of Var A Then (C-A) Else 0;

Var A is dependent on previously unmentioned variables, so I want the rankings to update as the other underlying variables change. Accordingly, I want Var D to change instantanesouly when program is run.
 
You'll have to run it through a couple of steps. Use proc Rank to create Var B, then subsequent processing can fix up Var C and D.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top