BookmarkSubscribeRSS Feed
otis
Calcite | Level 5


I need to create a random sample of 100K from a billion record dataset. I searched online and learned that I can use raununi (x). But when I ran it in SAS Enterprise guide 5.1, it returned an error message "

 

CLI describe error: [IBM][CLI Driver][DB2/AIX64] SQL0440N No authorized routine named "RANUNI" of type "FUNCTION" having

compatible arguments was found. SQLSTATE=42884

"

My codes are like:

"

proc sql;

create table aa as

   select *

from bb

where ranuni(5567) between 0.5 and 0.51

"

Any advice on how to create a random sample using SQL efficiently?

Thanks!

2 REPLIES 2
Steelers_In_DC
Barite | Level 11

If you have the right license for it I would use this:

proc surveyselect data=Customers

  method=srs n=15

  seed=1953 out=SampleStrata;

  strata State Type;

run;

If you must use sql all the info you need should be here:

http://www2.sas.com/proceedings/sugi31/168-31.pdf

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Randuni is a call function, therefore I don't think its available in proc SQL.  You can although use the rand() function:

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1022 views
  • 0 likes
  • 3 in conversation