DATA Step, Macro, Functions and more

Rank coming in decimal

Reply
Contributor
Posts: 20

Rank coming in decimal

I have getting this output by below code data, 

Col-1Col-2ranking
229ZO55
229ZO66
22BV612.5
22BV612.5
22BV612.5
22BV612.5

 

I am getting above ranking by below code, I am not expecting rank as 2.5, it should be 1 in all the case as it is based on col-2 and group by col-1.

 

code is

 

proc rank data= have out = want;
var col-2;by col-1;
ranks ranking;

run;

 

can someone tell me why this is coming as 2.5 and how to correct it.

 

 

 

 

Super User
Posts: 6,933

Re: Rank coming in decimal

Add to the PROC RANK statement:

 

ties=low

Ask a Question
Discussion stats
  • 1 reply
  • 95 views
  • 0 likes
  • 2 in conversation