BookmarkSubscribeRSS Feed
kashlik123
Obsidian | Level 7

I am working on a project where a model that was built in SAS has to implemented into Oracle SQL.

My question is simply how can I do this in Oracle SQL:

data have;
infile datalines delimiter=',';
input var $ value;
datalines;                      
var_x,1
var_x,1
var_x,1
var_x,2
var_x,2
var_x,2
var_x,3
var_x,3
var_x,3
var_x,4
var_x,4
var_x,5
;
run;

proc rank data=have out=want groups=10 ties=high;
var value;
ranks rank;
run;
1 REPLY 1
Tom
Super User Tom
Super User

Look into PERCENT_RANK() .  That should get you a number between zero and 1.  You could then use FLOOR() and division to generate a number between 0 and 9.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1366 views
  • 1 like
  • 2 in conversation