<?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 Non_Duplicating Random Number Assignment (Best Practice) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Non-Duplicating-Random-Number-Assignment-Best-Practice/m-p/310241#M20943</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've cruised this site for multiple methods of random number generation and assignment but did not find a good fit (as far as I know).&lt;/P&gt;
&lt;P&gt;My use case is a to assign a random number to a population of individuals. I don't care about uniform distribution of the random values.&lt;/P&gt;
&lt;P&gt;Is there a solid way to ensure no duplication of random numbers generated without having to go through do-loop iterations?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realize there is a much higher chance of random number duplication than might otherwise be expected but I'm suspecting there must be a quick/efficient/best-practice out there for this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2016 21:37:19 GMT</pubDate>
    <dc:creator>GalacticAbacus</dc:creator>
    <dc:date>2016-11-08T21:37:19Z</dc:date>
    <item>
      <title>Non_Duplicating Random Number Assignment (Best Practice)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Non-Duplicating-Random-Number-Assignment-Best-Practice/m-p/310241#M20943</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've cruised this site for multiple methods of random number generation and assignment but did not find a good fit (as far as I know).&lt;/P&gt;
&lt;P&gt;My use case is a to assign a random number to a population of individuals. I don't care about uniform distribution of the random values.&lt;/P&gt;
&lt;P&gt;Is there a solid way to ensure no duplication of random numbers generated without having to go through do-loop iterations?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realize there is a much higher chance of random number duplication than might otherwise be expected but I'm suspecting there must be a quick/efficient/best-practice out there for this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 21:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Non-Duplicating-Random-Number-Assignment-Best-Practice/m-p/310241#M20943</guid>
      <dc:creator>GalacticAbacus</dc:creator>
      <dc:date>2016-11-08T21:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Non_Duplicating Random Number Assignment (Best Practice)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Non-Duplicating-Random-Number-Assignment-Best-Practice/m-p/310246#M20944</link>
      <description>&lt;P&gt;It may be appropriate to discuss how you will use that random number. If the purpose is to select a random sample then the procedure Surveyselect may be a better idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The likelihood of duplication arises with larger numbers of records. So how big is your data set? Also sometimes "duplication" is the result of a default display format rounding values to a number of digits.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 21:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Non-Duplicating-Random-Number-Assignment-Best-Practice/m-p/310246#M20944</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-08T21:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Non_Duplicating Random Number Assignment (Best Practice)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Non-Duplicating-Random-Number-Assignment-Best-Practice/m-p/310248#M20945</link>
      <description>&lt;P&gt;This may not fit your idea of "quick" or "efficient" but it is tried and true and relatively easy to understand.&amp;nbsp; Old style coding:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data almost_there;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;random_order = ranuni(12345);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=almost_there;&lt;/P&gt;
&lt;P&gt;by random_order;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set almost_there;&lt;/P&gt;
&lt;P&gt;random_number = _n_;&lt;/P&gt;
&lt;P&gt;drop random_order;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assign a random fraction to each observation.&amp;nbsp; Then just number the observations in order.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 21:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Non-Duplicating-Random-Number-Assignment-Best-Practice/m-p/310248#M20945</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-11-08T21:54:51Z</dc:date>
    </item>
  </channel>
</rss>

