<?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: Aggregating dataset by date, including missing dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377680#M276352</link>
    <description>&lt;P&gt;Hey Ahmed.&lt;BR /&gt;&lt;BR /&gt;Thanks again for your help here, this is working perfectly!&lt;BR /&gt;&lt;BR /&gt;Couple of questions (I'm quite new to SAS, so don't completely understand the code here).&lt;BR /&gt;1) What is the "put" statement doing? I've read that it "holds the data", but I don't understand what that means? It means that it doesn't process the next row of data and allows you to output many rows before reinitialising the PDV?&lt;BR /&gt;2). Why is the "set" statement within the do loop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2017 11:32:00 GMT</pubDate>
    <dc:creator>MikeFranz</dc:creator>
    <dc:date>2017-07-20T11:32:00Z</dc:date>
    <item>
      <title>Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374533#M276324</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset, work.PIC, which contains transactions ($ amounts) per Address and Date. This&amp;nbsp;dataset is sorted by Address and Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample Dataset:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class="dgrid-header dgrid-header-row ui-widget-header"&gt;&lt;PRE&gt;&amp;nbsp; Address    Date      Amount&lt;BR /&gt; Property 1 31/01/2014 -770 &lt;BR /&gt; Property 1 31/01/2014 -550 &lt;BR /&gt; Property 1 31/01/2014 -20000 &lt;BR /&gt; Property 1 31/01/2014 -52329.6 &lt;BR /&gt; Property 1 31/07/2014 -660 &lt;BR /&gt; Property 1 31/10/2014 -1738 &lt;BR /&gt; Property 1 30/06/2015 -845.32 &lt;BR /&gt; Property 1 30/06/2015 845.32 &lt;BR /&gt; Property 1 30/06/2015 -845.32 &lt;BR /&gt; Property 1 31/12/2015 845.32 &lt;BR /&gt; Property 1 31/12/2015 -845.32 &lt;BR /&gt; Property 1 31/12/2015 845.32 &lt;BR /&gt; Property 2 31/01/2014 -1320 &lt;BR /&gt; Property 2 31/01/2014 -2895.99 &lt;BR /&gt; Property 2 31/01/2014 -653.32 &lt;BR /&gt; Property 2 31/01/2014 -40000 &lt;BR /&gt; Property 2 31/01/2014 -121954.8 &lt;BR /&gt; Property 2 30/09/2015 -3500 &lt;BR /&gt; Property 3 31/01/2014 -1200 &lt;BR /&gt; Property 3 31/01/2014 -28080 &lt;BR /&gt; Property 3 31/01/2014 -130483 &lt;BR /&gt; Property 3 30/11/2015 -885 &lt;BR /&gt; Property 3 31/12/2015 885&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class="dgrid-header dgrid-header-row ui-widget-header"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;For each&amp;nbsp;address, I would like to&amp;nbsp;create a running total per Address, with output at each Date. I have accomplished this through the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current code:&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data work.PIC_agg (keep = Address Date Value);
	set work.PIC;
	by Address Date;
	if First.Address then Value = 0;
	value + Amount;
	if Last.Date then output;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This issue with the above is that it then only contains information for each property on a date where transactions occurred e.g. Property 1 will only have entries for Jan14, Jul14, Oct14, Jun15, and Dec15.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would&amp;nbsp;like to have a value for each date i.e. from Jan14 through to Dec15. If there is no transaction in a given month, then the value equals the previous month's total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Proposed methodology:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Store each unique element of the Date variable in an array (DateArray)&lt;/P&gt;&lt;P&gt;Create a new variable for each element in DateArray&lt;/P&gt;&lt;P&gt;For each element in DataArray, sum over all transactions for a particular Address, where the Date&amp;lt;= DateArray&lt;/P&gt;&lt;P&gt;Store the resultant number in the correct variable for each Address&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on where the above methodology is sound, and, if so, how to implement. If not, could someone perhaps suggest a better method?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if the above is unclear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 16:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374533#M276324</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-10T16:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374586#M276325</link>
      <description>&lt;P&gt;You say you have a variable PERIOD, but you haven't shown us anything about that variable. You'll likely get more responses if you show the forum your example have and want datasets .. each in the form of datasteps and posted using the {i} icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 16:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374586#M276325</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-10T16:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374611#M276329</link>
      <description>&lt;P&gt;Hi, this uses an array but not in the way (I think) that you proposed. There probably is a more efficient INTNX-related metod, but &amp;nbsp;this fills in the missing months ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* aggregate amounts by address and date;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc summary data=x nway;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;class address date;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;var amount;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output out=xx (drop=_:) sum=;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* fill in the missing months;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;array _a(0:1000);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do j=1 by 1 until (last.address);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; set xx;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; by address;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; if first.address then first = date;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; _a(date - first) = amount;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do j=0 to (date - first);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; value = sum(value,_a(j));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; date = first+j;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; if day(date+1) eq 1 then output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;keep address date value;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Portion of output ...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA SET: y

 address           date       value

Property1    31/01/2014     -73649.60
Property1    28/02/2014     -73649.60
Property1    31/03/2014     -73649.60
Property1    30/04/2014     -73649.60
Property1    31/05/2014     -73649.60
Property1    30/06/2014     -73649.60
Property1    31/07/2014     -74309.60
Property1    31/08/2014     -74309.60
Property1    30/09/2014     -74309.60
Property1    31/10/2014     -76047.60
Property1    30/11/2014     -76047.60
Property1    31/12/2014     -76047.60
Property1    31/01/2015     -76047.60
Property1    28/02/2015     -76047.60
Property1    31/03/2015     -76047.60
Property1    30/04/2015     -76047.60
Property1    31/05/2015     -76047.60
Property1    30/06/2015     -76892.92
Property1    31/07/2015     -76892.92
Property1    31/08/2015     -76892.92
Property1    30/09/2015     -76892.92
Property1    31/10/2015     -76892.92
Property1    30/11/2015     -76892.92
Property1    31/12/2015     -76047.60
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 17:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374611#M276329</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2017-07-10T17:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374613#M276330</link>
      <description>&lt;P&gt;Hi Mike,&lt;/P&gt;
&lt;P&gt;Would the following work for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
length address $10 date 8 amount 8;
format date ddmmyy10.;
INPUT @1 address $10. @12 date :ddmmyy10. amount :best.;
datalines;
Property 1 31/01/2014 -770 
Property 1 31/01/2014 -550 
Property 1 31/01/2014 -20000 
Property 1 31/01/2014 -52329.6 
Property 1 31/07/2014 -660 
Property 1 31/10/2014 -1738 
Property 1 30/06/2015 -845.32 
Property 1 30/06/2015 845.32 
Property 1 30/06/2015 -845.32 
Property 1 31/12/2015 845.32 
Property 1 31/12/2015 -845.32 
Property 1 31/12/2015 845.32 
Property 2 31/01/2014 -1320 
Property 2 31/01/2014 -2895.99 
Property 2 31/01/2014 -653.32 
Property 2 31/01/2014 -40000 
Property 2 31/01/2014 -121954.8 
Property 2 30/09/2015 -3500 
Property 3 31/01/2014 -1200 
Property 3 31/01/2014 -28080 
Property 3 31/01/2014 -130483 
Property 3 30/11/2015 -885 
Property 3 31/12/2015 885
;
run;

/* Using the /SPARSE option to fill-in the missing dates for the properties */
proc freq data=have;
  table address*date / SPARSE out=all list noprint;
run;

/* Combine the original data with only the filler records (count=0) */
data final_v;
  SET have all(where=(count=0));
run;

/* Produce the final aggregation table */
proc summary data=final_v nway;
  class address date;
  var	amount;
  output out=want(drop=_:) sum=;
run;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 17:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374613#M276330</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2017-07-10T17:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374614#M276331</link>
      <description>Hey, thanks for the response. It says "Proc freq not found". Is it part of Base SAS?</description>
      <pubDate>Mon, 10 Jul 2017 17:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374614#M276331</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-10T17:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374617#M276332</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/109914"&gt;@MikeFranz&lt;/a&gt; wrote:&lt;BR /&gt;Hey, thanks for the response. It says "Proc freq not found". Is it part of Base SAS?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes it is. Check your code for other errors.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 17:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374617#M276332</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-10T17:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374625#M276333</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc freq data=work.pic;
  table address*Date / SPARSE out=all list noprint;
run;&lt;/PRE&gt;&lt;P&gt;which is copy paste from the solution, with&amp;nbsp;only the dataset name changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting the following errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt; ERROR: The FREQ procedure cannot be run.
 ERROR: Procedure FREQ not found.&lt;/PRE&gt;&lt;P&gt;I have been not been able to run PROC FREQ in the past. I had just assumed it was because it wasn't part of Base SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it helps, running&amp;nbsp;&lt;STRONG&gt;PROC SETINIT&amp;nbsp;&lt;/STRONG&gt;yields the following:&lt;/P&gt;&lt;PRE&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 55         
 56         PROC SETINIT;
 57         
 58         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 Original site validation data
 Current version: 9.04.01M3P062415
 System birthday:   19JAN2017.
 Operating System:   WX64_SV .
 Product expiration dates:
 ---Base SAS Software                                                                                    14JAN2018  
 ---SAS/GRAPH                                                                                            14JAN2018  
 ---SAS Integration Technologies                                                                         14JAN2018  
 ---SAS/Secure 168-bit                                                                                   14JAN2018  
 ---SAS/Secure Windows                                                                                   14JAN2018  
 ---SAS/ACCESS Interface to PC Files                                                                     14JAN2018  
 ---SAS/ACCESS Interface to ODBC                                                                         14JAN2018  
 ---SAS Workspace Server for Local Access                                                                14JAN2018  
 ---High Performance Suite                                                                               14JAN2018  
 ---SAS Search and Indexing Server                                                                       14JAN2018  
 ---SAS Web Crawler Server                                                                               14JAN2018  
 ---SAS LASR Analytic Server                                                                             14JAN2018  
 ---SAS Visual Analytics Hub                                                                             14JAN2018  
 ---SAS Visual Analytics Services                                                                        14JAN2018  
 ---SAS Visual Analytics Base                                                                            13JAN2018  
 ---Advanced Programming for LASR Analytic Server                                                        14JAN2018  
 ---SAS Visual Analytics Server Components                                                               14JAN2018  
 ---Visual Analytics Explorer                                                                            14JAN2018  &lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Jul 2017 17:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374625#M276333</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-10T17:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374626#M276334</link>
      <description>Hi,&lt;BR /&gt;Thank you for the response, very helpful!&lt;BR /&gt;Couple of follow up questions:&lt;BR /&gt;&lt;BR /&gt;1) Is there any way I could get the resultant dataset to contain each month up to a given period? For example, using the code you kindly provided, Property 1 data goes up to 31Dec15, while Property 2 data only goes up to 30Sep15. Ideally I would like all the properties to generate up to the same month, if that makes sense?&lt;BR /&gt;&lt;BR /&gt;2) Would you be able to walk me through what your code is doing? It clearly works, but I'm quite new to SAS and am not able to follow it.&lt;BR /&gt;&lt;BR /&gt;Thanks again for your help!</description>
      <pubDate>Mon, 10 Jul 2017 17:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374626#M276334</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-10T17:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374628#M276335</link>
      <description>&lt;P&gt;Hi, SPARSE does not add missing datesd to the data set ... yes/no? PROC FREQ can only count values that are present in the data. SPARSE only insures that table cells with ZERO values end up in a data set&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 18:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374628#M276335</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2017-07-10T18:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374631#M276336</link>
      <description>&lt;P&gt;For maximum date in the data set for all PROPERTIES ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;retain max_date;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;array _a(0:1000);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do j=1 by 1 until (last.address);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; set xx;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; by address;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; if first.address then first = date;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; _a(date - first) = amount;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; max_date = max(max_date, date);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do j=0 to max_date-first;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; value = sum(value,_a(j));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; date = first+j;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; if day(date+1) eq 1 then output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;keep address date value;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Send me an email ... msz03albany.edu ... and I'll do the walk through for you.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 18:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374631#M276336</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2017-07-10T18:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374636#M276337</link>
      <description>&lt;P&gt;Contact SAS tech support. They'll probably just walk you through re-installing SAS, but you definitey should have access to proc freq. I have to wonder what else you might be missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 18:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374636#M276337</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-10T18:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374640#M276338</link>
      <description>Many thanks, the above works perfectly.&lt;BR /&gt;&lt;BR /&gt;Tried sending you an email by it can't send, as it can't resolve the domain name in msz03albany.edu?</description>
      <pubDate>Mon, 10 Jul 2017 18:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374640#M276338</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-10T18:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374641#M276339</link>
      <description>Thanks for the response, I'll follow up with support.</description>
      <pubDate>Mon, 10 Jul 2017 18:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374641#M276339</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-10T18:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374656#M276340</link>
      <description>&lt;P&gt;There's no SAS/STAT license which may be the issue. Given the other modules I'm a bit shocked that SAS STAT wasn't included.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 19:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374656#M276340</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-10T19:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374724#M276341</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13759"&gt;@MikeZdeb&lt;/a&gt;is right,, the /SPARSE option does not fill-in all missing monthly values for every entry in the address/property group.&lt;/P&gt;
&lt;P&gt;Here is an alternative solution that does that, without Proc Freq &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length address $10 date 8 amount 8;
format date ddmmyy10.;
INPUT @1 address $10. @12 date :ddmmyy10. amount :best.;
datalines;
Property 1 31/01/2014 -770 
Property 1 31/01/2014 -550 
Property 1 31/01/2014 -20000 
Property 1 31/01/2014 -52329.6 
Property 1 31/07/2014 -660 
Property 1 31/10/2014 -1738 
Property 1 30/06/2015 -845.32 
Property 1 30/06/2015 845.32 
Property 1 30/06/2015 -845.32 
Property 1 31/12/2015 845.32 
Property 1 31/12/2015 -845.32 
Property 1 31/12/2015 845.32 
Property 2 31/01/2014 -1320 
Property 2 31/01/2014 -2895.99 
Property 2 31/01/2014 -653.32 
Property 2 31/01/2014 -40000 
Property 2 31/01/2014 -121954.8 
Property 2 30/09/2015 -3500 
Property 3 31/01/2014 -1200 
Property 3 31/01/2014 -28080 
Property 3 31/01/2014 -130483 
Property 3 30/11/2015 -885 
Property 3 31/12/2015 885
;
run;

/* Create aggregate by address,date */
proc summary data=have nway;
  class address date;
  var	amount;
  output out=have_sum(drop=_:) sum=;
run;

/* For every address, ensure there are no monthly gaps */
data want(KEEP=address date amount);

	length curr_dt curr_amt prev_dt prev_amt 8;
	retain curr_dt curr_amt prev_dt prev_amt;
	format curr_dt prev_dt ddmmyy10.;

	do until (last.address);

		SET have_sum;
		by address;

		if (first.address) then
			output; /* ensure it doesn't get left out */

		prev_dt= lag(date);
		prev_amt= lag(amount);
		*put prev_dt= prev_amt=;

		/* Find the monthly gap */
		diff= INTCK('month',prev_dt,date);
		*put diff=;

		if (diff &amp;gt; 0) then
		do; /* Fill-in missing months */

			/* Preserve current record values */
			curr_dt = date;
			curr_amt = amount;

			/* Output missing months */
			do i=1 to (diff-1) by 1;
			  date=intnx('month',prev_dt,i,'E');
			  amount=prev_amt;
			  OUTPUT;
			end;

			/* Don't forget current record */
			date=curr_dt;
			amount=curr_amt;
			OUTPUT;

		end; /* Fill-in missing months */
	end;
run;&lt;BR /&gt;&lt;BR /&gt;Proc print data=want; run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Output&lt;/P&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;address&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;date&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;amount&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/01/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-73649.60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;28/02/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-73649.60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/03/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-73649.60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/04/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-73649.60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/05/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-73649.60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;6&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/06/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-73649.60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;7&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/07/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-660.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;8&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/08/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-660.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;9&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/09/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-660.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;10&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/10/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;11&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/11/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;12&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/12/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;13&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/01/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;14&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;28/02/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;15&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/03/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;16&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/04/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;17&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/05/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-1738.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;18&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/06/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-845.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;19&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/07/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-845.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;20&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/08/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-845.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;21&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/09/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-845.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;22&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/10/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-845.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;23&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;30/11/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-845.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;24&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 1&lt;/TD&gt;
&lt;TD class="r data"&gt;31/12/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;845.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;25&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/01/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;26&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;28/02/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;27&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/03/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;28&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;30/04/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;29&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/05/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;30&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;30/06/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;31&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/07/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;32&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/08/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;33&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;30/09/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;34&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/10/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;35&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;30/11/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;36&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/12/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;37&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/01/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;38&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;28/02/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;39&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/03/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;40&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;30/04/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;41&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/05/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;42&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;30/06/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;43&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/07/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;44&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;31/08/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-166824.11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;45&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 2&lt;/TD&gt;
&lt;TD class="r data"&gt;30/09/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-3500.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;46&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/01/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;47&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;28/02/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;48&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/03/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;49&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/04/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;50&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/05/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;51&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/06/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;52&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/07/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;53&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/08/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;54&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/09/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;55&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/10/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;56&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/11/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;57&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/12/2014&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;58&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/01/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;59&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;28/02/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;60&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/03/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;61&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/04/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;62&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/05/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;63&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/06/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;64&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/07/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;65&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/08/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;66&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/09/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;67&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/10/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-159763.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;68&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;30/11/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;-885.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;69&lt;/TH&gt;
&lt;TD class="l data"&gt;Property 3&lt;/TD&gt;
&lt;TD class="r data"&gt;31/12/2015&lt;/TD&gt;
&lt;TD class="r data"&gt;885.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Jul 2017 21:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374724#M276341</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2017-07-10T21:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374729#M276342</link>
      <description>&lt;P&gt;Hi, still needs a couple fixes, only worked since the &amp;nbsp;max date is in the first group of addresses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will fix later and send to you. My&amp;nbsp;email is&amp;nbsp;msz03@albany.edu&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 22:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/374729#M276342</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2017-07-10T22:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377393#M276343</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm&amp;nbsp;looking at this again today, and just noticed I'm getting some strange results.&lt;/P&gt;&lt;P&gt;If I use the dataset below:&lt;/P&gt;&lt;PRE&gt;Address                 Date            Amount&lt;BR /&gt;1000 Sumac Drive	31/05/2014	250
1000 Sumac Drive	30/06/2014	184252
1000 Sumac Drive	31/07/2014	4100
1000 Sumac Drive	31/08/2014	2572
1000 Sumac Drive	28/02/2015	402.98
1000 Sumac Drive	31/08/2015	-933.87
1000 Sumac Drive	30/09/2015	6520.72
1000 Sumac Drive	31/12/2015	-2632.98&lt;/PRE&gt;&lt;P&gt;I'm getting the following output:&lt;/P&gt;&lt;PRE&gt;1000 Sumac Drive	31/05/2014	-2382.98	
1000 Sumac Drive	30/06/2014	181869.02	
1000 Sumac Drive	31/07/2014	185969.02	
1000 Sumac Drive	31/08/2014	188541.02	
1000 Sumac Drive	30/09/2014	188541.02	
1000 Sumac Drive	31/10/2014	188541.02	
1000 Sumac Drive	30/11/2014	188541.02	
1000 Sumac Drive	31/12/2014	188541.02	
1000 Sumac Drive	31/01/2015	188541.02	
1000 Sumac Drive	28/02/2015	188944	
1000 Sumac Drive	31/03/2015	188944	
1000 Sumac Drive	30/04/2015	188944	
1000 Sumac Drive	31/05/2015	188944	
1000 Sumac Drive	30/06/2015	188944	
1000 Sumac Drive	31/07/2015	188944	
1000 Sumac Drive	31/08/2015	188010.13	
1000 Sumac Drive	30/09/2015	194530.85	
1000 Sumac Drive	31/10/2015	194530.85	
1000 Sumac Drive	30/11/2015	194530.85	
1000 Sumac Drive	31/12/2015	191897.87	
1000 Sumac Drive	31/01/2016	191897.87	
1000 Sumac Drive	29/02/2016	191897.87	
1000 Sumac Drive	31/03/2016	191897.87	
1000 Sumac Drive	30/04/2016	191897.87	
1000 Sumac Drive	31/05/2016	191897.87	
1000 Sumac Drive	30/06/2016	191897.87	
1000 Sumac Drive	31/07/2016	191897.87	
1000 Sumac Drive	31/08/2016	191897.87	
1000 Sumac Drive	30/09/2016	191897.87	
1000 Sumac Drive	31/10/2016	191897.87	
1000 Sumac Drive	30/11/2016	191897.87	
1000 Sumac Drive	31/12/2016	191897.87	
1000 Sumac Drive	31/01/2017	191897.87	
1000 Sumac Drive	28/02/2017	191897.87	
1000 Sumac Drive	31/03/2017	191897.87	
1000 Sumac Drive	30/04/2017	191897.87	
1000 Sumac Drive	31/05/2017	191897.87	
1000 Sumac Drive	30/06/2017	191897.87	
1000 Sumac Drive	31/07/2017	191897.87	&lt;/PRE&gt;&lt;P&gt;I can't work out why it is misbehaving?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight would be amazing!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377393#M276343</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-19T15:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377396#M276344</link>
      <description>If it helps at all, it seems to be aggregating the first and last lines of the first dataset into the first line of second dataset, I just don't know why</description>
      <pubDate>Wed, 19 Jul 2017 15:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377396#M276344</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-19T15:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377428#M276345</link>
      <description>Mike,&lt;BR /&gt;Check my 2nd answer (07/10/17 5:xx PM) to your original post. I had included a sample output, that may just match what you are looking for?&lt;BR /&gt;&lt;BR /&gt;Ahmed</description>
      <pubDate>Wed, 19 Jul 2017 16:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377428#M276345</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2017-07-19T16:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating dataset by date, including missing dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377429#M276346</link>
      <description>Oh hey, sorry, I hadn't seen this, hiding on the second page. It looks close, but it looks as though the running total is resetting every now at then? For example property 1 resets on line 7</description>
      <pubDate>Wed, 19 Jul 2017 16:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregating-dataset-by-date-including-missing-dates/m-p/377429#M276346</guid>
      <dc:creator>MikeFranz</dc:creator>
      <dc:date>2017-07-19T16:06:33Z</dc:date>
    </item>
  </channel>
</rss>

