<?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 get an accumulating time period? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/307774#M61130</link>
    <description>&lt;P&gt;Sample data and sample output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2016 21:56:57 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-10-27T21:56:57Z</dc:date>
    <item>
      <title>How to get an accumulating time period?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/307750#M61127</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My dataset has t&lt;/SPAN&gt;&lt;SPAN&gt;hree&lt;/SPAN&gt;&lt;SPAN&gt; columns, one is apps&lt;/SPAN&gt;&lt;SPAN&gt;, the second is approvals, and the &lt;/SPAN&gt;&lt;SPAN&gt;third &lt;/SPAN&gt;&lt;SPAN&gt;is wantdate, I want to calculate the total apps and total approvals, and then group by wantdate. But I want the date as an accumulating time period. for example, &lt;/SPAN&gt;&amp;nbsp;if the startdate=01/01/2016, and enddate=02/27/2016. The wandate should cover the data as wantdate1, which is 01/01/2016, wantdate2, which is betweem&amp;nbsp;01/01/2016 and 01/02/2016, wantdate3, which is between&amp;nbsp;&lt;SPAN&gt;01/01/2016 and 01/03/2016,wantdate4, which is &lt;SPAN&gt;between&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;01/01/2016 and 01/04/2016.....and the last one is wantdate57, which is &amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;between&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;01/01/2016 and 02/27/2016. Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 19:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/307750#M61127</guid>
      <dc:creator>zhangda</dc:creator>
      <dc:date>2016-10-27T19:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an accumulating time period?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/307774#M61130</link>
      <description>&lt;P&gt;Sample data and sample output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:56:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/307774#M61130</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-27T21:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an accumulating time period?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/307821#M61132</link>
      <description>&lt;P&gt;I think you are looking for something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let startDate=01jan2016;
%let enddate=27feb2016;

data periods;
startdate = "&amp;amp;startdate."d;
do enddate = startdate to "&amp;amp;enddate."d;
    period + 1;
    output;
    end;
format startdate enddate yymmdd10.;
run;

proc sql;
create table want as
select b.period, sum(a.apps) as sumApps, sum(a.approval) as sumApprovals 
from have as a inner join 
    periods as b on a.wantdate between b.startdate and b.enddate
group by b.period;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Oct 2016 03:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/307821#M61132</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-10-28T03:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an accumulating time period?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/308091#M61150</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Sat, 29 Oct 2016 17:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-an-accumulating-time-period/m-p/308091#M61150</guid>
      <dc:creator>zhangda</dc:creator>
      <dc:date>2016-10-29T17:43:39Z</dc:date>
    </item>
  </channel>
</rss>

