<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic use sql to create a random sample in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/use-sql-to-create-a-random-sample/m-p/206468#M51328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;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 "&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;CLI describe error: [IBM][CLI Driver][DB2/AIX64] SQL0440N No authorized routine named "RANUNI" of type "FUNCTION" having &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compatible arguments was found. SQLSTATE=42884 &lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;My codes are like:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; create table aa as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt; from bb&lt;/P&gt;&lt;P&gt; where ranuni(5567) between 0.5 and 0.51&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;Any advice on how to create a random sample using SQL efficiently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2015 15:07:41 GMT</pubDate>
    <dc:creator>otis</dc:creator>
    <dc:date>2015-04-29T15:07:41Z</dc:date>
    <item>
      <title>use sql to create a random sample</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-sql-to-create-a-random-sample/m-p/206468#M51328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;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 "&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;CLI describe error: [IBM][CLI Driver][DB2/AIX64] SQL0440N No authorized routine named "RANUNI" of type "FUNCTION" having &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compatible arguments was found. SQLSTATE=42884 &lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;My codes are like:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; create table aa as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt; from bb&lt;/P&gt;&lt;P&gt; where ranuni(5567) between 0.5 and 0.51&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;Any advice on how to create a random sample using SQL efficiently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 15:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-sql-to-create-a-random-sample/m-p/206468#M51328</guid>
      <dc:creator>otis</dc:creator>
      <dc:date>2015-04-29T15:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: use sql to create a random sample</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-sql-to-create-a-random-sample/m-p/206469#M51329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the right license for it I would use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc surveyselect data=Customers&lt;/P&gt;&lt;P&gt;&amp;nbsp; method=srs n=15&lt;/P&gt;&lt;P&gt;&amp;nbsp; seed=1953 out=SampleStrata;&lt;/P&gt;&lt;P&gt;&amp;nbsp; strata State Type;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you must use sql all the info you need should be here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi31/168-31.pdf" title="http://www2.sas.com/proceedings/sugi31/168-31.pdf"&gt;http://www2.sas.com/proceedings/sugi31/168-31.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 15:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-sql-to-create-a-random-sample/m-p/206469#M51329</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-04-29T15:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: use sql to create a random sample</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-sql-to-create-a-random-sample/m-p/206470#M51330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Randuni is a call function, therefore I don't think its available in proc SQL.&amp;nbsp; You can although use the rand() function:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001466748.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001466748.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 15:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-sql-to-create-a-random-sample/m-p/206470#M51330</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-29T15:51:38Z</dc:date>
    </item>
  </channel>
</rss>

