<?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: Generate uniques randoms dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351673#M273755</link>
    <description>&lt;P&gt;One problem: there are only 1096 unique dates in the three year range.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2017 13:32:14 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2017-04-20T13:32:14Z</dc:date>
    <item>
      <title>Generate uniques randoms dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351641#M273753</link>
      <description>&lt;P&gt;To generate random date in sas, I use this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data random_date;
  mindate='01jan2015'd;
  maxdate='30dec2017'd;
  range = maxdate-mindate+1;
  format mindate maxdate randate date9.;
  do i = 1 to 100000;
    RanDate = mindate + int(ranuni(12345)*range);
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But how can I generate uniques randoms dates ?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 12:29:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351641#M273753</guid>
      <dc:creator>John4</dc:creator>
      <dc:date>2017-04-20T12:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generate uniques randoms dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351645#M273754</link>
      <description>&lt;P&gt;Well to get rid of duplicates you would do:&lt;/P&gt;
&lt;PRE&gt;proc sort data=randomdate nodupkey;
&amp;nbsp; by randate;
run;&lt;/PRE&gt;
&lt;P&gt;However I don't think that is what your after is it? &amp;nbsp;You want 10000 unique dates of a random nature yes? &amp;nbsp;If so then just loop over your min/max range, and then sample for the items across this range yes/no 10000 results:&lt;/P&gt;
&lt;PRE&gt;data want;
  do randate='01jan2015'd to '30dec2017'd;
    output;
  end;
run;
proc surveyselect data=want;
  method=srs n=10000 out=SampleSRS;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Apr 2017 12:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351645#M273754</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-20T12:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Generate uniques randoms dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351673#M273755</link>
      <description>&lt;P&gt;One problem: there are only 1096 unique dates in the three year range.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 13:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351673#M273755</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-04-20T13:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Generate uniques randoms dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351680#M273756</link>
      <description>&lt;P&gt;That would depend on how many fruit bearing trees you had over those 3 years no? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But good question, can't have 10000 unique dates in that period.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 13:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351680#M273756</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-20T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Generate uniques randoms dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351690#M273757</link>
      <description>&lt;P&gt;So I have to change the number and also the dates like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;mindate='01jan1900'd;
maxdate='30dec2017'd;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 14:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-uniques-randoms-dates/m-p/351690#M273757</guid>
      <dc:creator>John4</dc:creator>
      <dc:date>2017-04-20T14:00:20Z</dc:date>
    </item>
  </channel>
</rss>

