<?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: Distribute Days between 2 dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389754#M93462</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91103"&gt;@Aidan&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;There is certainly a solution but you need to better explain what you have and what you need; i.e: where are these 2 dates? On a single row in 2 variables and you want to generate multiple rows with consecutive dates?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best provide a SAS data step which creates a HAVE data set and then show us how the desired result should look like.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2017 10:07:44 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2017-08-22T10:07:44Z</dc:date>
    <item>
      <title>Distribute Days between 2 dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389746#M93459</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't know if this is feasible in SAS but I know its possible in other tools.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have a data set and there is 2 dates e.g.&lt;/P&gt;&lt;P&gt;1/Jan/2017 and 22/Apr/2017 so there is 111 days betwen these 2 dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to achieve is distributing these days to a particular month, so the first 30 days go to Jan 17, the second 28 go to Feb 17, 31 to Mar and 22 to Apr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas if this can be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Aidan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 09:44:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389746#M93459</guid>
      <dc:creator>Aidan</dc:creator>
      <dc:date>2017-08-22T09:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute Days between 2 dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389754#M93462</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91103"&gt;@Aidan&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;There is certainly a solution but you need to better explain what you have and what you need; i.e: where are these 2 dates? On a single row in 2 variables and you want to generate multiple rows with consecutive dates?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best provide a SAS data step which creates a HAVE data set and then show us how the desired result should look like.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 10:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389754#M93462</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-08-22T10:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute Days between 2 dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389756#M93463</link>
      <description>&lt;P&gt;So the below is something that I would have for instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So item 1 keeps the days to April 2014&lt;/P&gt;&lt;P&gt;Item 2 has 3 for Jun 2014&lt;/P&gt;&lt;P&gt;Item 3 then is spread across more than 1 month&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Item&lt;/TD&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;Days 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;22-Apr-14&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;11-Jun-14&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;27-Feb-14&lt;/TD&gt;&lt;TD&gt;114&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 10:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389756#M93463</guid>
      <dc:creator>Aidan</dc:creator>
      <dc:date>2017-08-22T10:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute Days between 2 dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389757#M93464</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91103"&gt;@Aidan&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You haven't shown us how the desired result should look like so not sure if below will give you what you're after. It should point you into the right direction though especially when it comes to working with SAS Date values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines truncover dlm=' ';
  input Item Date:anydtdte. Days;
  format date date9.;
  datalines;
1 22-Apr-14 4
2 11-Jun-14 3
3 27-Feb-14 114
;
run;

data want;
  set have;
  format target_date date9.;
  do target_date=date to date+days;
    output;
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 21:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389757#M93464</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-08-22T21:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute Days between 2 dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389770#M93471</link>
      <description>This looks great Patrick I can work with this now, thanks very much for your quick response</description>
      <pubDate>Tue, 22 Aug 2017 11:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distribute-Days-between-2-dates/m-p/389770#M93471</guid>
      <dc:creator>Aidan</dc:creator>
      <dc:date>2017-08-22T11:37:39Z</dc:date>
    </item>
  </channel>
</rss>

