<?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 Re: Random Sample with Proc SQL in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-with-Proc-SQL/m-p/540818#M33228</link>
    <description>&lt;P&gt;Use a datastep?&amp;nbsp; Extract data from the database, then run a proc surveryselect over that to get your sample:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_surveyselect_sect003.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_surveyselect_sect003.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2019 16:12:07 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-03-06T16:12:07Z</dc:date>
    <item>
      <title>Random Sample with Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-with-Proc-SQL/m-p/540810#M33227</link>
      <description>&lt;P&gt;I am attempting to create a random sample using proc sql. I found this article from the&amp;nbsp;SAS website&amp;nbsp;that uses the function RANUNI ( &lt;A href="http://www2.sas.com/proceedings/sugi31/168-31.pdf" target="_blank" rel="nofollow noopener noreferrer"&gt;the following paper&lt;/A&gt; ) however when I try to run this I get an error saying RANUNI "is not a recognized build-in function name. "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I using it incorrectly or is there another function I can use for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my code using SAS EG to try and get a 10% sample:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;connect&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sqlsvrasfrprod(datasrc=frproduser=&amp;amp;uidpassword=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;pawd"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; readbuff=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sample &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; connection to frprod( &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;distinct&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;a.startdate, a.notifydate, a.id, a.ctype, a.type, a.longdesc,&lt;/P&gt;&lt;P&gt;b.account,&lt;/P&gt;&lt;P&gt;c.ctypid&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; comp.dbo.comp a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;join comp.dbo.accounts b&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a.id=b.id &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;join comp.dbo.ban c&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;on&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;left&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(b.account,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)=c.bannumber &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ctypid &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;between&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ranuni(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1234&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;between&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.45&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.55&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 15:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-with-Proc-SQL/m-p/540810#M33227</guid>
      <dc:creator>eaherbst</dc:creator>
      <dc:date>2019-03-06T15:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample with Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-with-Proc-SQL/m-p/540818#M33228</link>
      <description>&lt;P&gt;Use a datastep?&amp;nbsp; Extract data from the database, then run a proc surveryselect over that to get your sample:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_surveyselect_sect003.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_surveyselect_sect003.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 16:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Random-Sample-with-Proc-SQL/m-p/540818#M33228</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-06T16:12:07Z</dc:date>
    </item>
  </channel>
</rss>

