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.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

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
  • 1224 views
  • 1 like
  • 2 in conversation