<?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: How to generate random dates in sas over a certain period time. Quite urgent in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361213#M85152</link>
    <description>Thank You RW9. It's what I need.&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
    <pubDate>Wed, 24 May 2017 13:52:28 GMT</pubDate>
    <dc:creator>Question</dc:creator>
    <dc:date>2017-05-24T13:52:28Z</dc:date>
    <item>
      <title>How to generate random dates in sas over a certain period time. Quite urgent</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361161#M85135</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table that contains customer_id (around 1 Millions) and would like to create some random dates for these customers between 01/01/2015 and 01/01/2017 .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please your help would be much appreciated as it is quite urgent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank You very much&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 12:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361161#M85135</guid>
      <dc:creator>Question</dc:creator>
      <dc:date>2017-05-24T12:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate random dates in sas over a certain period time. Quite urgent</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361164#M85136</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start=01/01/2015;
%let end=01/01/2017;

data _null_;
start = input("&amp;amp;start",ddmmyy10.);
end = input("&amp;amp;end",ddmmyy10.);
interval = end - start;
call symput('start',put(start,best.));
call symput('interval',put(interval,best.));
run;

data want;
set have;
format newdate ddmmyy10.;
newdate = &amp;amp;start + rand() * &amp;amp;interval;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 12:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361164#M85136</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-24T12:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate random dates in sas over a certain period time. Quite urgent</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361165#M85137</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Post test data in the for of a datastep!! &amp;nbsp;Also post what you want out.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example, the diff between the two dates * by random number added to the base date, gives a date between the two values:&lt;/P&gt;
&lt;PRE&gt;data tmp;
  call streaminit(123);      
  a="01JAN2015"d;
  b="01JAN2017"d;
  test="01JAN2015"d + floor((b-a) * rand("uniform"));
  format a b test date9.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 May 2017 12:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361165#M85137</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-24T12:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate random dates in sas over a certain period time. Quite urgent</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361213#M85152</link>
      <description>Thank You RW9. It's what I need.&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Wed, 24 May 2017 13:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-random-dates-in-sas-over-a-certain-period-time/m-p/361213#M85152</guid>
      <dc:creator>Question</dc:creator>
      <dc:date>2017-05-24T13:52:28Z</dc:date>
    </item>
  </channel>
</rss>

