<?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: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683848#M207164</link>
    <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The full run:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;29 data W.HAVE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;30 VALUE=1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;31 do DATE='01jan2020:0:0'dt to '31aug2020:23:59:59'dt by '06:00:00't;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;32 do ACCT =1 to 2e6;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;33 if ranuni(1) &amp;gt; .9 then output;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;34 end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;35 end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;36 run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.HAVE has 195196814 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.HAVE decreased size by 81.74 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:22.70&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:03.18&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.04 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 8538.03k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 29552.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:41:39 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 54 Switch Count 4339&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;37 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;38 data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;39 call execute('data ');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;40 do I=1 to 20;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;41 call execute (cat('W.TMP',I));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;42 end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;43 do I=1 to 20;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;44 call execute(ifc(I=1,';set W.HAVE;','else '));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;45 call execute (cat('if ',I-1,'e5 &amp;lt;= ACCT &amp;lt; ',I,'e5 then output W.TMP',I,';'));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;46 end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;47 run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 0.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 328.46k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 21600.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:41:39 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 55 Switch Count 54&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: CALL EXECUTE generated line.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;1 + data&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2 + W.TMP1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;3 + W.TMP2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;4 + W.TMP3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;5 + W.TMP4&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;6 + W.TMP5&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;7 + W.TMP6&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;8 + W.TMP7&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;9 + W.TMP8&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;10 + W.TMP9&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;11 + W.TMP10&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;12 + W.TMP11&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;13 + W.TMP12&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;14 + W.TMP13&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;15 + W.TMP14&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;16 + W.TMP15&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;17 + W.TMP16&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;18 + W.TMP17&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;19 + W.TMP18&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20 + W.TMP19&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;21 + W.TMP20&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;22 + ;set W.HAVE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;23 + if 0e5 &amp;lt;= ACCT &amp;lt; 1e5 then output W.TMP1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;24 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;25 + if 1e5 &amp;lt;= ACCT &amp;lt; 2e5 then output W.TMP2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;26 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;27 + if 2e5 &amp;lt;= ACCT &amp;lt; 3e5 then output W.TMP3;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;28 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;29 + if 3e5 &amp;lt;= ACCT &amp;lt; 4e5 then output W.TMP4;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;30 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;31 + if 4e5 &amp;lt;= ACCT &amp;lt; 5e5 then output W.TMP5;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;32 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;33 + if 5e5 &amp;lt;= ACCT &amp;lt; 6e5 then output W.TMP6;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;34 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;35 + if 6e5 &amp;lt;= ACCT &amp;lt; 7e5 then output W.TMP7;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;36 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;37 + if 7e5 &amp;lt;= ACCT &amp;lt; 8e5 then output W.TMP8;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;38 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;39 + if 8e5 &amp;lt;= ACCT &amp;lt; 9e5 then output W.TMP9;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;40 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;41 + if 9e5 &amp;lt;= ACCT &amp;lt; 10e5 then output W.TMP10;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;42 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;43 + if 10e5 &amp;lt;= ACCT &amp;lt; 11e5 then output W.TMP11;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;44 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;45 + if 11e5 &amp;lt;= ACCT &amp;lt; 12e5 then output W.TMP12;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;46 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;47 + if 12e5 &amp;lt;= ACCT &amp;lt; 13e5 then output W.TMP13;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;48 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;49 + if 13e5 &amp;lt;= ACCT &amp;lt; 14e5 then output W.TMP14;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;50 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;51 + if 14e5 &amp;lt;= ACCT &amp;lt; 15e5 then output W.TMP15;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;52 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;53 + if 15e5 &amp;lt;= ACCT &amp;lt; 16e5 then output W.TMP16;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;54 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;55 + if 16e5 &amp;lt;= ACCT &amp;lt; 17e5 then output W.TMP17;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;56 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;57 + if 17e5 &amp;lt;= ACCT &amp;lt; 18e5 then output W.TMP18;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;58 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;59 + if 18e5 &amp;lt;= ACCT &amp;lt; 19e5 then output W.TMP19;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;60 + else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;61 + if 19e5 &amp;lt;= ACCT &amp;lt; 20e5 then output W.TMP20;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;48&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 195196814 observations read from the data set W.HAVE.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP1 has 9757439 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP1 decreased size by 79.71 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP2 has 9761847 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP2 decreased size by 80.57 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP3 has 9755925 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP3 decreased size by 81.11 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP4 has 9755351 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP4 decreased size by 81.54 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP5 has 9763311 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP5 decreased size by 81.53 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP6 has 9762058 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP6 decreased size by 81.81 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP7 has 9762421 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP7 decreased size by 81.90 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP8 has 9756555 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP8 decreased size by 81.90 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP9 has 9758082 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP9 decreased size by 81.90 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP10 has 9762843 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP10 decreased size by 81.90 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP11 has 9756001 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP11 decreased size by 81.99 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP12 has 9758699 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP12 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP13 has 9761100 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP13 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP14 has 9757221 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP14 decreased size by 82.08 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP15 has 9760533 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP15 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP16 has 9757133 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP16 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP17 has 9760740 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP17 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP18 has 9763384 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP18 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP19 has 9762164 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP19 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP20 has 9763895 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP20 decreased size by 82.09 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 39.35 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 40.04 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 2.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 171106.57k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 191232.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:42:18 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 56 Switch Count 4351&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;49 data _null_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;50 do I=1 to 20;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;51 call execute (cat('proc sort data=W.TMP',I,'; by ACCT DATE; run; '));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;52 call execute ('proc sql; create table W.OUT as select a.*, mean(b.VALUE) as AVG ');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;53 call execute (cat('from W.TMP', I, ' a left join W.TMP', I, ' b '));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;54 call execute ('on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24 ');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;55 call execute ('group by a.ACCT, a.DATE, a.VALUE; quit; ');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;56 call execute ('proc append base=W.WANT data=W.OUT; run; ');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;57 end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;58 run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 0.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 0.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 330.12k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 23648.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:42:18 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 57 Switch Count 52&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: CALL EXECUTE generated line.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;1 + proc sort data=W.TMP1; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9757439 observations read from the data set W.TMP1.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP1 has 9757439 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP1 decreased size by 75.26 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.04 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.67 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.45 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 65420.46k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 88932.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:42:21 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 58 Switch Count 256&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;2 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;3 + from W.TMP1 a left join W.TMP1 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;4 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;5 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 79.97 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9757439 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;5 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:36.96&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:17.06&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.18 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982567.39k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006868.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:43:58 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 59 Switch Count 316&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;6 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: BASE data set does not exist. DATA file is being copied to BASE file.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9757439 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 9757439 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 79.97 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.03 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.93 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.18 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11641.37k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 37248.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:44:00 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 60 Switch Count 325&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;7 + proc sort data=W.TMP2; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9761847 observations read from the data set W.TMP2.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP2 has 9761847 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP2 decreased size by 75.30 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.90 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 8.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.37 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64787.68k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89700.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:44:04 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 61 Switch Count 258&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;8 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;8 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;9 + from W.TMP2 a left join W.TMP2 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;10 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;11 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.00 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9761847 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;11 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:37.21&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:15.84&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.60 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982711.54k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007124.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:45:41 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 62 Switch Count 322&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;12 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9761847 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9761847 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 19519286 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 79.99 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.40 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.76 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.18 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11361.12k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 37248.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:45:44 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 63 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;13 + proc sort data=W.TMP3; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9755925 observations read from the data set W.TMP3.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP3 has 9755925 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP3 decreased size by 75.30 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.67 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.93 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.20 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64353.18k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89188.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:45:48 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 64 Switch Count 264&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;14 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;14 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;15 + from W.TMP3 a left join W.TMP3 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;16 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;17 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9755925 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;17 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:31.93&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:18.28&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.46 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982717.39k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006868.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:47:20 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 65 Switch Count 328&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;18 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9755925 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9755925 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 29275211 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 79.99 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.31 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.79 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11360.96k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36480.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:47:22 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 66 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;19 + proc sort data=W.TMP4; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9755351 observations read from the data set W.TMP4.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP4 has 9755351 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP4 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.35 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.61 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.43 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64691.18k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89700.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:47:25 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 67 Switch Count 262&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;20 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;21 + from W.TMP4 a left join W.TMP4 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;22 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;23 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9755351 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;23 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:30.07&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:16.65&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.26 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982720.70k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006868.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:48:55 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 68 Switch Count 323&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;24 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9755351 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9755351 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 39030562 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.00 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1.95 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.82 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.14 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11361.43k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36224.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:48:57 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 69 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;25 + proc sort data=W.TMP5; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9763311 observations read from the data set W.TMP5.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP5 has 9763311 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP5 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 4.07 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.75 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.43 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64580.65k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89188.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:49:01 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 70 Switch Count 289&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;26 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;26 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;27 + from W.TMP5 a left join W.TMP5 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;28 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;29 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9763311 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;29 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:40.38&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:17.93&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.62 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 983408.57k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007896.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:50:42 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 71 Switch Count 310&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;30 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9763311 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9763311 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 48793873 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.00 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1.87 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.92 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.21 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11137.18k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36480.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:50:44 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 72 Switch Count 323&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;31 + proc sort data=W.TMP6; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762058 observations read from the data set W.TMP6.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP6 has 9762058 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP6 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.98 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.64 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.31 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 65252.59k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89700.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:50:48 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 73 Switch Count 272&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;32 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;32 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;33 + from W.TMP6 a left join W.TMP6 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;34 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;35 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9762058 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;35 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:46.23&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:18.07&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.43 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982492.60k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007380.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:52:34 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 74 Switch Count 328&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;36 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762058 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9762058 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 58555931 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.00 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.65 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 2.07 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11251.56k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36992.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:52:37 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 75 Switch Count 328&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;37 + proc sort data=W.TMP7; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762421 observations read from the data set W.TMP7.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP7 has 9762421 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP7 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 6.04 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.70 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.21 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 65253.25k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 90212.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:52:43 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 76 Switch Count 273&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;38 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;38 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;39 + from W.TMP7 a left join W.TMP7 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;40 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;41 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9762421 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;41 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2:10.78&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:13.96&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.60 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982607.32k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007892.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:54:54 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 77 Switch Count 330&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;42 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762421 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9762421 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 68318352 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.00 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 4.18 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.75 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.14 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11362.28k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 37248.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:54:58 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 78 Switch Count 327&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;43 + proc sort data=W.TMP8; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9756555 observations read from the data set W.TMP8.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP8 has 9756555 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP8 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 5.81 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 8.37 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.35 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64577.84k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89700.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:55:04 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 79 Switch Count 260&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;44 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;44 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;45 + from W.TMP8 a left join W.TMP8 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;46 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;47 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9756555 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;47 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2:12.95&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:18.17&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.59 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982613.87k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006356.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:57:17 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 80 Switch Count 328&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;48 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9756555 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9756555 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 78074907 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.00 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 6.59 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.73 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.12 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11363.43k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36224.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:57:24 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 81 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;49 + proc sort data=W.TMP9; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9758082 observations read from the data set W.TMP9.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP9 has 9758082 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP9 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 6.29 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.29 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64596.15k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89188.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:57:30 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 82 Switch Count 295&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;50 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;50 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;51 + from W.TMP9 a left join W.TMP9 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;52 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;53 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9758082 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;53 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:32.81&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:16.87&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 2.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982736.64k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006868.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:59:03 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 83 Switch Count 327&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;54 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9758082 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9758082 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 87832989 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.00 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.81 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11362.28k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36736.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:59:05 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 84 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;55 + proc sort data=W.TMP10; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762843 observations read from the data set W.TMP10.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP10 has 9762843 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP10 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.57 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.45 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.28 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64241.87k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 88676.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 02:59:08 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 85 Switch Count 262&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;56 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;56 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;57 + from W.TMP10 a left join W.TMP10 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;58 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;59 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9762843 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;59 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:46.00&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:22.04&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.59 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 983749.64k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1008152.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:00:54 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 86 Switch Count 292&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;60 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762843 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9762843 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 97595832 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.79 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.89 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.07 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11362.50k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 37248.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:00:57 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 87 Switch Count 332&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;61 + proc sort data=W.TMP11; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9756001 observations read from the data set W.TMP11.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP11 has 9756001 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP11 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 4.82 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.37 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.51 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64484.43k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89956.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:01:02 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 88 Switch Count 352&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;62 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;62 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;63 + from W.TMP11 a left join W.TMP11 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;64 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;65 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9756001 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;65 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:31.79&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:16.17&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.62 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982736.67k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007124.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:02:34 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 89 Switch Count 327&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;66 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9756001 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9756001 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 107351833 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.73 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.18 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11361.15k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36736.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:02:35 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 90 Switch Count 332&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;67 + proc sort data=W.TMP12; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9758699 observations read from the data set W.TMP12.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP12 has 9758699 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP12 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.90 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.48 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.43 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64465.90k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89700.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:02:38 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 91 Switch Count 265&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;68 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;68 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;69 + from W.TMP12 a left join W.TMP12 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;70 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;71 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9758699 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;71 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:16.48&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:15.57&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.64 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982604.29k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006868.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:03:55 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 92 Switch Count 316&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;72 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9758699 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9758699 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 117110532 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.06 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.85 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.10 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11361.87k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36736.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:03:57 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 93 Switch Count 322&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;73 + proc sort data=W.TMP13; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9761100 observations read from the data set W.TMP13.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP13 has 9761100 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP13 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.48 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.21 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.42 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64370.68k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89188.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:04:00 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 94 Switch Count 262&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;74 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;74 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;75 + from W.TMP13 a left join W.TMP13 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;76 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;77 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9761100 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;77 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:48.70&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:18.07&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.85 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982606.70k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007124.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:05:49 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 95 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;78 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9761100 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9761100 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 126871632 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.62 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.76 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11248.59k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36992.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:05:52 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 96 Switch Count 325&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;79 + proc sort data=W.TMP14; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9757221 observations read from the data set W.TMP14.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP14 has 9757221 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP14 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 4.78 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.36 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.42 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64915.62k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89956.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:05:57 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 97 Switch Count 259&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;80 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;80 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;81 + from W.TMP14 a left join W.TMP14 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;82 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;83 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9757221 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;83 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:42.58&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:18.12&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.62 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982604.17k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006868.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:07:39 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 98 Switch Count 322&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;84 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9757221 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9757221 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 136628853 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.28 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.75 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.21 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11250.18k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36480.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:07:43 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 99 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;85 + proc sort data=W.TMP15; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9760533 observations read from the data set W.TMP15.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP15 has 9760533 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP15 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 5.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 8.04 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.14 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64594.12k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 88932.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:07:48 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 100 Switch Count 257&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;86 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;86 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;87 + from W.TMP15 a left join W.TMP15 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;88 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;89 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.02 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9760533 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;89 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:52.97&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:18.12&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.34 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 983635.42k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007640.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:09:41 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 101 Switch Count 319&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;90 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9760533 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9760533 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 146389386 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.54 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.85 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.21 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11251.18k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36224.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:09:43 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 102 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;91 + proc sort data=W.TMP16; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9757133 observations read from the data set W.TMP16.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP16 has 9757133 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP16 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.78 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.40 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.40 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64466.78k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 88932.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:09:47 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 103 Switch Count 277&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;92 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;92 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;93 + from W.TMP16 a left join W.TMP16 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;94 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;95 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9757133 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;95 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:53.46&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:20.43&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.60 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982719.57k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1006868.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:11:41 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 104 Switch Count 319&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;96 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9757133 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9757133 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 156146519 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1.18 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.79 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.12 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11249.75k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36992.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:11:42 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 105 Switch Count 332&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;97 + proc sort data=W.TMP17; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9760740 observations read from the data set W.TMP17.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP17 has 9760740 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP17 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 5.68 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 8.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.39 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64707.06k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89956.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:11:48 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 106 Switch Count 288&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;98 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;98 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;99 + from W.TMP17 a left join W.TMP17 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;100 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;101 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9760740 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;101 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:15.79&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:15.35&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.15 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982718.82k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007380.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:13:04 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 107 Switch Count 322&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;102 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9760740 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9760740 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 165907259 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1.17 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.73 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.12 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11362.37k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 37248.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:13:05 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 108 Switch Count 338&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;103 + proc sort data=W.TMP18; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9763384 observations read from the data set W.TMP18.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP18 has 9763384 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP18 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.96 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.54 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.34 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64579.59k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89700.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:13:08 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 109 Switch Count 271&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;104 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;104 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;105 + from W.TMP18 a left join W.TMP18 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;106 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;107 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9763384 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;107 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:35.59&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:16.67&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.60 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 983760.70k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1008152.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:14:43 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 110 Switch Count 322&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;108 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9763384 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9763384 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 175670643 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 3.76 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.59 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.20 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11361.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36992.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:14:47 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 111 Switch Count 330&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;109 + proc sort data=W.TMP19; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762164 observations read from the data set W.TMP19.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP19 has 9762164 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP19 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 6.73 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.20 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.20 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64466.46k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89188.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:14:54 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 112 Switch Count 271&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;110 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;110 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;111 + from W.TMP19 a left join W.TMP19 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;112 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;113 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9762164 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;113 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2:10.28&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:13.26&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.45 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 982720.64k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1007124.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:17:05 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 113 Switch Count 317&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;114 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9762164 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9762164 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 185432807 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 2.78 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.70 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.07 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11360.56k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 36992.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:17:08 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 114 Switch Count 316&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;115 + proc sort data=W.TMP20; by ACCT DATE; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Sorting was performed by the data source.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9763895 observations read from the data set W.TMP20.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.TMP20 has 9763895 observations and 3 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.TMP20 decreased size by 75.31 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 5.15 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 7.07 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.65 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 64594.12k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 89700.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:17:13 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 115 Switch Count 257&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;116 + proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;116 + create table W.OUT as select a.*, mean(b.VALUE) as AVG&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;117 + from W.TMP20 a left join W.TMP20 b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;118 + on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;119 + group by a.ACCT, a.DATE, a.VALUE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: SAS threaded sort was used.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.OUT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Table W.OUT created, with 9763895 rows and 4 columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;119 + quit;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1:25.20&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1:17.31&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 1.64 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 983744.17k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 1008408.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:18:38 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 116 Switch Count 306&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;120 + proc append base=W.WANT data=W.OUT; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Appending W.OUT to W.WANT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: There were 9763895 observations read from the data set W.OUT.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: 9763895 observations added.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The data set W.WANT has 195196702 observations and 4 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Compressing data set W.WANT decreased size by 80.01 percent.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROCEDURE APPEND used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;real time 1.98 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;user cpu time 1.73 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system cpu time 0.15 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;memory 11362.09k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OS Memory 37504.00k&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Timestamp 15/09/2020 03:18:40 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Step Count 117 Switch Count 326&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;59 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;60 /* Insert custom code after submitted code here */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;61 run;%z_eg_post_run;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;###################################################&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# Elapse time: 00h38m24s&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;###################################################&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# SYSCC=0 SYSERR=0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;###################################################&lt;/FONT&gt;&lt;/P&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;37&amp;nbsp;&lt;FONT face="arial,helvetica,sans-serif"&gt;minutes to split and match the 200 million records in 20 chunks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I have no idea why proc sql sorts the data again, as indicated by the message &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;NOTE: SAS threaded sort was used.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;There is room for gains here, if one can figure out what on earth is going on.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2020 04:05:15 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-09-15T04:05:15Z</dc:date>
    <item>
      <title>Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683320#M206948</link>
      <description>&lt;P&gt;I will try and describe my problem in pseudo-code.&amp;nbsp; I am a self-taught programmer, so I apologize in advance for any gaps in my vocabulary and knowledge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have transaction data across accounts down to the second.&amp;nbsp; The problem with every moving average answer I have looked up is, the data is always very structured and designed in a way to make the calculation relatively easy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The transaction data is difficult, because it can vary wildly depending on the account.&amp;nbsp; An account might have 10 transactions in a 24 hour period, or 5 transactions over 10 days.&amp;nbsp; I need to be able to check and see if the previous transactions were within 24 hours, and if not, do not count them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a fake dataset with dates that are commensurate with the problems I am facing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
    input customerid : 7.
	transactionid: $13.
        date : datetime26.
        value : 3.
    ;
    format date datetime26.;

datalines;
2133780 2133780_00355 15JUN2020:12:47:17.000000   53
2133780 2133780_00687 15JUN2020:12:48:35.000000   72
2133780 2133780_00181 15JUN2020:12:59:44.000000   88
2133780 2133780_00273 15JUN2020:16:43:46.000000   96
2133780 2133780_00803 16JUN2020:22:30:15.000000   25
2133780 2133780_00411 17JUN2020:07:22:18.000000   75
2133780 2133780_00191 17JUN2020:23:16:39.000000   59
2133780 2133780_00461 14JUL2020:09:35:32.000000   22
2133780 2133780_00532 21JUL2020:10:40:54.000000   46
2133780 2133780_00609 28JUL2020:09:58:30.000000   36
2133780 2133780_00504 28JUL2020:10:12:55.000000   87
2133780 2133780_00488 31JUL2020:15:30:44.000000   36
2689999 2689999_00284 02JUN2020:09:03:55.000000   44
2689999 2689999_00734 06JUN2020:11:20:23.000000   95
2689999 2689999_00061 06JUN2020:13:40:22.000000   29
2689999 2689999_00540 07JUN2020:14:00:19.000000   14
2689999 2689999_00616 08JUN2020:13:36:24.000000   14
2689999 2689999_00002 08JUN2020:13:59:32.000000   82
2689999 2689999_00966 04JUL2020:11:29:49.000000   21
2689999 2689999_00859 10JUL2020:14:46:37.000000   34
2689999 2689999_00816 29JUL2020:13:56:45.000000   95
2689999 2689999_00045 29JUL2020:15:12:19.000000   42
2689999 2689999_00481 02AUG2020:11:02:21.000000   38
2689999 2689999_00227 02AUG2020:11:03:41.000000   42
2689999 2689999_00354 02AUG2020:12:26:34.000000   42
2689999 2689999_00794 03AUG2020:09:10:43.000000   73
2689999 2689999_00857 20AUG2020:15:03:19.000000   16

;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, for each account, I need to:&lt;/P&gt;&lt;P&gt;1)Loop through every transaction&lt;/P&gt;&lt;P&gt;2)On each transaction, review all previous transactions and compare the transaction date to the previous date and calculate how long ago it occurred&lt;/P&gt;&lt;P&gt;3)Count those transactions that qualify&lt;/P&gt;&lt;P&gt;4)Sum those transaction amounts that qualify&lt;/P&gt;&lt;P&gt;5)Divide to find average&lt;/P&gt;&lt;P&gt;6)Repeat&lt;/P&gt;&lt;P&gt;7)Reset when you get to a new account&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the Hash Object will be the best route, because there could be tens of millions of rows.&amp;nbsp; I have begun reading 'Data Management Solutions Using SAS Hash Table Operations' but the concept is so foreign to me, I am having trouble grasping it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I have tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;

dcl hash transactions(dataset:"sample",multidata:"Y",ordered:"A");
 transactions.defineKey("customerid");
 transactions.defineData("Date","value");
 transactions.defineDone();
dcl hash accounts(dataset:"sample(rename=(date=base_date))",multidata:"Y",ordered:"A");
 accounts.defineKey("customerid");
 accounts.defineData("customerid","base_date");
 accounts.defineDone();
/* define the result hash object tables */
 dcl hash h_pointer;
 dcl hash byAccount(ordered:"A");
 byAccount.defineKey("customerid");
 byAccount.defineData("customerid","Date","value","_average");
 byAccount.defineDone();

if 0 then set sample;
format base_date datetime26.;

 lr = 0;
 do until(lr);
    set sample end = lr;
	call missing(customerid,date,base_date,value);
	accounts.find();
	transactions_rc = transactions.find();
	do while(transactions_rc=0);
		time_diff = intck('second',base_date,date);
		put time_diff;
		if (-86400 le intck('second',base_date,date) le 86400) then leave;
		transactions_rc = transactions.find_next();
	end;
	h_pointer = byAccount;
	link calculator;
end;

stop;
calculator:
	call missing(date,value,_average);
	rc = h_pointer.find();
	counts 			+1;
	h_pointer.replace();
return;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Right now, it is just trying to count.&amp;nbsp; Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13569"&gt;@DonH&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 19:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683320#M206948</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-11T19:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683402#M206989</link>
      <description>&lt;P&gt;I believe the has object is a good fit. You might want the check out the section on stacks - a separate stack for each day - output (as appropriate) and clearing as you complete each day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do have a couple of questions about your requirements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;3)Count those transactions that qualify&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;4)Sum those transaction amounts that qualify&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;5)Divide to find average&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;I am not sure I know what you mean by "transactions that qualify" as well as what to do with the results.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 03:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683402#M206989</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2020-09-12T03:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683403#M206990</link>
      <description>&lt;P&gt;SQL would be a lot more suitable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table WANT as
  select a.*, mean(b.VALUE)
  from HAVE a left join HAVE b
  on a.CUSTOMERID=b.CUSTOMERID and b.DATE between a.DATE and a.DATE-3600*24
  group by a.CUSTOMERID, a.DATE, a.VALUE, a.TRANSACTIONID
  order by a.CUSTOMERID, a.DATE, a.VALUE;
&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;</description>
      <pubDate>Sat, 12 Sep 2020 03:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683403#M206990</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-12T03:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683433#M207007</link>
      <description>&lt;PRE&gt;data sample;
    input customerid : 7.
	transactionid: $13.
        date : datetime26.
        value : 3.
    ;
    format date datetime26.;
datalines;
2133780 2133780_00355 15JUN2020:12:47:17.000000   53
2133780 2133780_00687 15JUN2020:12:48:35.000000   72
2133780 2133780_00181 15JUN2020:12:59:44.000000   88
2133780 2133780_00273 15JUN2020:16:43:46.000000   96
2133780 2133780_00803 16JUN2020:22:30:15.000000   25
2133780 2133780_00411 17JUN2020:07:22:18.000000   75
2133780 2133780_00191 17JUN2020:23:16:39.000000   59
2133780 2133780_00461 14JUL2020:09:35:32.000000   22
2133780 2133780_00532 21JUL2020:10:40:54.000000   46
2133780 2133780_00609 28JUL2020:09:58:30.000000   36
2133780 2133780_00504 28JUL2020:10:12:55.000000   87
2133780 2133780_00488 31JUL2020:15:30:44.000000   36
2689999 2689999_00284 02JUN2020:09:03:55.000000   44
2689999 2689999_00734 06JUN2020:11:20:23.000000   95
2689999 2689999_00061 06JUN2020:13:40:22.000000   29
2689999 2689999_00540 07JUN2020:14:00:19.000000   14
2689999 2689999_00616 08JUN2020:13:36:24.000000   14
2689999 2689999_00002 08JUN2020:13:59:32.000000   82
2689999 2689999_00966 04JUL2020:11:29:49.000000   21
2689999 2689999_00859 10JUL2020:14:46:37.000000   34
2689999 2689999_00816 29JUL2020:13:56:45.000000   95
2689999 2689999_00045 29JUL2020:15:12:19.000000   42
2689999 2689999_00481 02AUG2020:11:02:21.000000   38
2689999 2689999_00227 02AUG2020:11:03:41.000000   42
2689999 2689999_00354 02AUG2020:12:26:34.000000   42
2689999 2689999_00794 03AUG2020:09:10:43.000000   73
2689999 2689999_00857 20AUG2020:15:03:19.000000   16
;
run;
data sample;
 set sample;
 date=int(date);
run;
/*Assuming there are not duplicated date within a customerid */
data want;
 if _n_=1 then do;
   if 0 then set sample;
   declare hash h();
   h.definekey('date');
   h.definedata('value');
   h.definedone();
 end;

h.clear();
do until(last.customerid);
 set sample;
 by customerid;
 h.add();
end;

array x{99999} _temporary_;
do until(last.customerid);
 set sample;
 by customerid;
 i=0;call missing(of x{*});
 do temp=intnx('hour',date,-24,'s') to date;
   	if h.find(key:temp)=0 then do;i+1;x{i}=value;end;
 end;
 rolling_mean=mean(of x{*});
 output;
end;

drop i temp;
run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Sep 2020 12:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683433#M207007</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-09-12T12:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683450#M207014</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial, sans-serif; font-size: 10pt;"&gt;3)Count those transactions that qualify&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;4)Sum those transaction amounts that qualify&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;What I mean, if you look at the transactions in the sample data, is that as time passes, older transactions fall out of the 24 hour window.&amp;nbsp; That is what I meant when I said they would no longer "qualify". That they wouldn't be considered for the current line's 24 hour calculation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;I have done the calculations by hand to see what I want the result table to look like.&amp;nbsp; I hope it helps:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Row&lt;/TD&gt;&lt;TD&gt;customerid&lt;/TD&gt;&lt;TD&gt;transactionid&lt;/TD&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;TD&gt;value&lt;/TD&gt;&lt;TD&gt;count&lt;/TD&gt;&lt;TD&gt;running_ave&lt;/TD&gt;&lt;TD&gt;Notes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00355&lt;/TD&gt;&lt;TD&gt;15Jun2020 12:47:17&lt;/TD&gt;&lt;TD&gt;53&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;53.0&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;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00687&lt;/TD&gt;&lt;TD&gt;15Jun2020 12:48:35&lt;/TD&gt;&lt;TD&gt;72&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;62.5&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;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00181&lt;/TD&gt;&lt;TD&gt;15Jun2020 12:59:44&lt;/TD&gt;&lt;TD&gt;88&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;71.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00273&lt;/TD&gt;&lt;TD&gt;15Jun2020 16:43:46&lt;/TD&gt;&lt;TD&gt;96&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;77.3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00803&lt;/TD&gt;&lt;TD&gt;16Jun2020 22:30:15&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;25.0&lt;/TD&gt;&lt;TD&gt;More than 24 hours passed since the last transaction, a full reset&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00411&lt;/TD&gt;&lt;TD&gt;17Jun2020 7:22:18&lt;/TD&gt;&lt;TD&gt;75&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;50.0&lt;/TD&gt;&lt;TD&gt;Even though a "day" has passed, it is June 17th now, the previous transaction is still within a 24 hour window&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00191&lt;/TD&gt;&lt;TD&gt;17Jun2020 23:16:39&lt;/TD&gt;&lt;TD&gt;59&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;67.0&lt;/TD&gt;&lt;TD&gt;The transaction on row 5 now falls away, but the previous transaction on row 6 is within a 24 hour window&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00461&lt;/TD&gt;&lt;TD&gt;14Jul2020 9:35:32&lt;/TD&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;22.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00532&lt;/TD&gt;&lt;TD&gt;21Jul2020 10:40:54&lt;/TD&gt;&lt;TD&gt;46&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;46.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00609&lt;/TD&gt;&lt;TD&gt;28Jul2020 9:58:30&lt;/TD&gt;&lt;TD&gt;36&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;36.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00504&lt;/TD&gt;&lt;TD&gt;28Jul2020 10:12:55&lt;/TD&gt;&lt;TD&gt;87&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;61.5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;2133780&lt;/TD&gt;&lt;TD&gt;2133780_00488&lt;/TD&gt;&lt;TD&gt;31Jul2020 15:30:44&lt;/TD&gt;&lt;TD&gt;36&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;36.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00284&lt;/TD&gt;&lt;TD&gt;02Jun2020 9:03:55&lt;/TD&gt;&lt;TD&gt;44&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;44.0&lt;/TD&gt;&lt;TD&gt;A new CustomerId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00734&lt;/TD&gt;&lt;TD&gt;06Jun2020 11:20:23&lt;/TD&gt;&lt;TD&gt;95&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;95.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00061&lt;/TD&gt;&lt;TD&gt;06Jun2020 13:40:22&lt;/TD&gt;&lt;TD&gt;29&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;62.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00540&lt;/TD&gt;&lt;TD&gt;07Jun2020 14:00:19&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;14.0&lt;/TD&gt;&lt;TD&gt;This is just outside of the 24 hour window of the previous transaction&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00616&lt;/TD&gt;&lt;TD&gt;08Jun2020 13:36:24&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;14.0&lt;/TD&gt;&lt;TD&gt;This is just inside of the 24 hour window of the previous transaction&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00002&lt;/TD&gt;&lt;TD&gt;08Jun2020 13:59:32&lt;/TD&gt;&lt;TD&gt;82&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;36.7&lt;/TD&gt;&lt;TD&gt;This is around 30 seconds from being outside the 24 hour window of the previous 2 transactions.&amp;nbsp; This is how granular I want it to get&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00966&lt;/TD&gt;&lt;TD&gt;04Jul2020 11:29:49&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;21.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00859&lt;/TD&gt;&lt;TD&gt;10Jul2020 14:46:37&lt;/TD&gt;&lt;TD&gt;34&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;34.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00816&lt;/TD&gt;&lt;TD&gt;29Jul2020 13:56:45&lt;/TD&gt;&lt;TD&gt;95&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;95.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00045&lt;/TD&gt;&lt;TD&gt;29Jul2020 15:12:19&lt;/TD&gt;&lt;TD&gt;42&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;68.5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00481&lt;/TD&gt;&lt;TD&gt;02Aug2020 11:02:21&lt;/TD&gt;&lt;TD&gt;38&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;38.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00227&lt;/TD&gt;&lt;TD&gt;02Aug2020 11:03:41&lt;/TD&gt;&lt;TD&gt;42&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40.0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00354&lt;/TD&gt;&lt;TD&gt;02Aug2020 12:26:34&lt;/TD&gt;&lt;TD&gt;42&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;40.7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00794&lt;/TD&gt;&lt;TD&gt;03Aug2020 9:10:43&lt;/TD&gt;&lt;TD&gt;73&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;48.8&lt;/TD&gt;&lt;TD&gt;A new day, but still within 24 hours of the previous 3 transactions&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;27&lt;/TD&gt;&lt;TD&gt;2689999&lt;/TD&gt;&lt;TD&gt;2689999_00857&lt;/TD&gt;&lt;TD&gt;20Aug2020 15:03:19&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;16.0&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;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sat, 12 Sep 2020 17:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683450#M207014</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-12T17:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683451#M207015</link>
      <description>&lt;P&gt;I agree for the small sample data set, but across 100 million rows of transaction data, it is just not reasonable.&amp;nbsp; While researching, I discovered hash tables and thought that would be the perfect solution for lighting fast lookups and calculations at such a scale.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 17:17:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683451#M207015</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-12T17:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683453#M207016</link>
      <description>&lt;P&gt;Wow, this works flawlessly on the table I provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There could be duplicates in the date field, so I provided a 'transactionid' to show unique transactions. Fraudsters can really hammer merchants with quick transactions and if some transactions are processed in batches, the dates might match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can sort of wrap my head around your code.&amp;nbsp; It is leveraging the hash table to do a lookup.&amp;nbsp; If there were a duplicate date, would it just stop at the first instance of that date occurring?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 17:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683453#M207016</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-12T17:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683456#M207017</link>
      <description>&lt;P&gt;If the data were sorted by timestamp/customerid, then I would go to the hash approach - in fact you would need a hash-of-hashes to enable tracking of a varying number of qualifying records over a varying number of customerid's.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this data is sorted by customerid/timestamp&amp;nbsp; (where "date" is the misleading name for timestamp).&amp;nbsp; So let's assume it is impossible for there to be more than 400 transactions per customerid.&amp;nbsp; Then:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
    input customerid : 7.
	transactionid: $13.
        date : datetime26.
        value : 3.
    ;
    format date datetime26.;

datalines;
2133780 2133780_00355 15JUN2020:12:47:17.000000   53
2133780 2133780_00687 15JUN2020:12:48:35.000000   72
2133780 2133780_00181 15JUN2020:12:59:44.000000   88
2133780 2133780_00273 15JUN2020:16:43:46.000000   96
2133780 2133780_00803 16JUN2020:22:30:15.000000   25
2133780 2133780_00411 17JUN2020:07:22:18.000000   75
2133780 2133780_00191 17JUN2020:23:16:39.000000   59
2133780 2133780_00461 14JUL2020:09:35:32.000000   22
2133780 2133780_00532 21JUL2020:10:40:54.000000   46
2133780 2133780_00609 28JUL2020:09:58:30.000000   36
2133780 2133780_00504 28JUL2020:10:12:55.000000   87
2133780 2133780_00488 31JUL2020:15:30:44.000000   36
2689999 2689999_00284 02JUN2020:09:03:55.000000   44
2689999 2689999_00734 06JUN2020:11:20:23.000000   95
2689999 2689999_00061 06JUN2020:13:40:22.000000   29
2689999 2689999_00540 07JUN2020:14:00:19.000000   14
2689999 2689999_00616 08JUN2020:13:36:24.000000   14
2689999 2689999_00002 08JUN2020:13:59:32.000000   82
2689999 2689999_00966 04JUL2020:11:29:49.000000   21
2689999 2689999_00859 10JUL2020:14:46:37.000000   34
2689999 2689999_00816 29JUL2020:13:56:45.000000   95
2689999 2689999_00045 29JUL2020:15:12:19.000000   42
2689999 2689999_00481 02AUG2020:11:02:21.000000   38
2689999 2689999_00227 02AUG2020:11:03:41.000000   42
2689999 2689999_00354 02AUG2020:12:26:34.000000   42
2689999 2689999_00794 03AUG2020:09:10:43.000000   73
2689999 2689999_00857 20AUG2020:15:03:19.000000   16

;
run;

%let interval=24:00:00;

data rolling_recent_counts (drop= j _:);
  set sample;
  by customerid;
  array _dats{400} _temporary_;
  array _vals{400} _temporary_;
  if first.customerid then call missing(of _n,_value_sum,_jlast);

  _n+1;
  _value_sum+value;

  _dats{_n}=date;
  _vals{_n}=value;

  _jlast+0;  /*Lazy way to retain, and reset missing at first.customerid above to zero */
  do j=_jlast+1 by 1 while (_dats{j} &amp;lt; date - "&amp;amp;interval"t); 
    _value_sum = _value_sum - _vals{j};
	call missing(_dats{j},_vals{j});
	_jlast=j;
  end;
  n_values=_n - _jlast;
  avg_value=_value_sum/n_values;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The variable _N is the record number for the current customerid, initialized to 1 for each customer.&amp;nbsp; And _JLAST is the record number for the most recent &lt;EM&gt;&lt;STRONG&gt;non-qualifying&lt;/STRONG&gt;&lt;/EM&gt; record, so it is initialized to zero for each customer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a customer can have more than 400 records, then just change the size of the _VALS and _DATS arrays to accomodate the largest possible record count.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit comment:&amp;nbsp; I took out an extraneous statement with a PUT statement I was using to track the program logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note you can set the interval however you want in the %let statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 18:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683456#M207017</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-09-12T18:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683457#M207018</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;If the data were sorted by timestamp/customerid, then I would go to the hash approach - in fact you would need a hash-of-hashes to enable tracking of a varying number of qualifying records over a varying number of customerid's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Actually the transaction data&amp;nbsp;&lt;U&gt;is&lt;/U&gt; sorted by timestamp/customerid in the database where I actually need to do the work.&amp;nbsp; I thought the sample data sorted by timestamp would be the best way to illustrate my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was introduced to the&amp;nbsp;concept on Hash of Hashes by watching a SAS training video on youtube Paul Dorfman and Don Henderson presented. I then checked the book out from a university library.&amp;nbsp; I have no formal training in software engineering or programming, so I find the concepts difficult to grasp. I feel like I have a very basic understanding, but am having trouble applying the concepts in the book to my own real world scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you mind tackling the problem as if the data were sorted by&amp;nbsp;&lt;SPAN&gt;timestamp/customerid?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 18:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683457#M207018</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-12T18:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683458#M207019</link>
      <description>&lt;P&gt;Also, someone else in the comments below mentioned how they would use hash of hashes if the date were sorted by&amp;nbsp;&lt;SPAN&gt;timestamp/customerid.&amp;nbsp; I wanted to say, in the actual transaction data I am using, the data is sorted in this manner.&amp;nbsp; I chose to present the sample data sorted by customerid/timestamp f&lt;/SPAN&gt;&lt;SPAN&gt;or the purpose of illustrating my problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 18:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683458#M207019</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-12T18:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683464#M207021</link>
      <description>&lt;P&gt;Mark makes a good point about this being a problem that can be done with the Hash of Hash approach. However, that approach requires that you can fit all the transactions for all the customers into memory. If you can't, you will have to do some sort of looping. Given that you have to implement looping thru customers (I'm assuming that each customer is processed independently), the benefit of the Hash of Hash approach (a separate hash object for each customer) may not be worth it (unless you also have lots of customers.&lt;BR /&gt;&lt;BR /&gt;There are multiple ways to do this looping. Before I suggest anything can you provide any details about how many customers you could have in your input file and a rough guesstimate as to the maximum number of transactions a customer may ?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 19:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683464#M207021</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2020-09-12T19:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683473#M207023</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13569"&gt;@DonH&lt;/a&gt; :&amp;nbsp; I agree.&amp;nbsp; The only reason I would recommend hash-of-hashes would be if the data were sorted by timestamp/customerid.&amp;nbsp; Otherwise it's wasteful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, even in that scenario the OP wouldn't need to keep &lt;EM&gt;&lt;STRONG&gt;all&lt;/STRONG&gt;&lt;/EM&gt; the records for all the customers in the hash objects - just the last 24 hours for each customer.&amp;nbsp; Of course, that memory savings would be at the expense of adding code to remove data items from a hash as they become stale.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The OP's task is logically equivalent to maintaining a portfolio of stocks with irregularly implemented BUYs and SELLs of one or another constituent of the portfolio, which is the context in which I wrote &lt;A href="https://www.lexjansen.com/mwsug/2018/SB/MWSUG-2018-SB-60.pdf" target="_self"&gt;From Stocks to Flows: Using SAS® Hash Objects for FIFO, LIFO, and other FO’s&lt;/A&gt;.&amp;nbsp; In particular, the OP's task is like a FIFO treatment of inventory.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 22:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683473#M207023</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-09-12T22:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683481#M207030</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345149"&gt;@Array_Mover&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I agree for the small sample data set, but across 100 million rows of transaction data, it is just not reasonable.&amp;nbsp; While researching, I discovered hash tables and thought that would be the perfect solution for lighting fast lookups and calculations at such a scale.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not necessarily. You don't need all the rows at once for this logic to work. The minimum you need is all the rows for a given account at once.&lt;/P&gt;
&lt;P&gt;So you could process the table say one hundredth of the table (say all accounts between 1 and 1000000, 1000001 and 2000000, etc) at a time and still get all the results you need.&lt;/P&gt;
&lt;P&gt;If you have 20 transactions per account on average, that's a 20-million row table, which the SQL parser might well decide to load into a hash table. Or not.&lt;/P&gt;
&lt;P&gt;In any case, not complex programming, no &lt;EM&gt;interpreted&lt;/EM&gt; vs &lt;EM&gt;compiled&lt;/EM&gt; inefficiencies, and since it seems you are going to load partial hash tables, you might be better off loading partial tables into SQL instead.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 02:13:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683481#M207030</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-13T02:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683487#M207034</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13569"&gt;@DonH&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I greatly appreciate all of you chiming in. Would love to myself ... but haven't time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 04:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683487#M207034</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2020-09-13T04:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683490#M207036</link>
      <description>&lt;P&gt;Here's a hash-of-hashes solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
  input customerid : 7.  transactionid: $13.
        date : datetime26.  value : 3. ;
    format date datetime26.;
datalines;
2133780 2133780_00355 15JUN2020:12:47:17.000000   53
2133780 2133780_00687 15JUN2020:12:48:35.000000   72
2133780 2133780_00181 15JUN2020:12:59:44.000000   88
2133780 2133780_00273 15JUN2020:16:43:46.000000   96
2133780 2133780_00803 16JUN2020:22:30:15.000000   25
2133780 2133780_00411 17JUN2020:07:22:18.000000   75
2133780 2133780_00191 17JUN2020:23:16:39.000000   59
2133780 2133780_00461 14JUL2020:09:35:32.000000   22
2133780 2133780_00532 21JUL2020:10:40:54.000000   46
2133780 2133780_00609 28JUL2020:09:58:30.000000   36
2133780 2133780_00504 28JUL2020:10:12:55.000000   87
2133780 2133780_00488 31JUL2020:15:30:44.000000   36
2689999 2689999_00284 02JUN2020:09:03:55.000000   44
2689999 2689999_00734 06JUN2020:11:20:23.000000   95
2689999 2689999_00061 06JUN2020:13:40:22.000000   29
2689999 2689999_00540 07JUN2020:14:00:19.000000   14
2689999 2689999_00616 08JUN2020:13:36:24.000000   14
2689999 2689999_00002 08JUN2020:13:59:32.000000   82
2689999 2689999_00966 04JUL2020:11:29:49.000000   21
2689999 2689999_00859 10JUL2020:14:46:37.000000   34
2689999 2689999_00816 29JUL2020:13:56:45.000000   95
2689999 2689999_00045 29JUL2020:15:12:19.000000   42
2689999 2689999_00481 02AUG2020:11:02:21.000000   38
2689999 2689999_00227 02AUG2020:11:03:41.000000   42
2689999 2689999_00354 02AUG2020:12:26:34.000000   42
2689999 2689999_00794 03AUG2020:09:10:43.000000   73
2689999 2689999_00857 20AUG2020:15:03:19.000000   16
run;

proc sort;
  by date customerid;
run;


data want (drop=_:);
  set sample;

  if _n_=1 then do;
    declare hash hoh ();
      hoh.definekey('customerid');
      hoh.definedata('customerid','h','ih','_value_sum','nvalues');
      hoh.definedone();
    declare hash h;
    declare hiter ih;
  end;

  /* New customerid?  Initialize a new hash &amp;amp; iterator. */
  if hoh.find()^=0 then do;
    h=_new_ hash(ordered:'a',multidata:'Y');  /*Added the MULTIDATA option*/
      h.definekey('date');
      h.definedata('date','value');
      h.definedone();
    ih=_new_ hiter('h');
    _value_sum=0;
    nvalues=0;
  end;
  h.add();

  _value_sum = _value_sum + value;
  nvalues=nvalues+1;

  _stale_timestamp = date - '24:00:00't;
  format _stale_timestamp datetime20.;

  array _drop_dates {0:100} ;
 
  /* Adjust _value_sum and nvalues for all stale timestamps */
  /* Also capture their dates to guide stale dataitems deletions*/
  do _rc=ih.first() by 0 while(date&amp;lt;_stale_timestamp);
    _value_sum = _value_sum-value;
    nvalues = nvalues -1;
    _ndd=n(of _drop_dates{*});
	if _drop_dates{_ndd}^=date then _drop_dates{_ndd+1}=date;
	_rc=ih.next();
  end;

  /* Replace updated _value_sum and nvalues in hoh */
  hoh.replace();

  /* Now remove any stale timestamps from h */
  _ndd=n(of _drop_dates{*});
  if _ndd&amp;gt;0 then do _d=1 to _ndd;
    h.remove(key:_drop_dates{_d});
    _drop_dates{_d}=.;
  end;

  average=_value_sum/nvalues;
  ih.last();  /*Retrieve date and value of most recent record*/
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Using the multidata:"Y" option alleviates the need to use transactionid as a hash key for storage purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are duplicate dates they all appear in the hash object, but each date only appears once in the _dropdates array.&amp;nbsp; That's not a problem because the remove method will remove all duplicates for the specific key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also this assumes that there are no more than 100 records in any 24 hour period for a given customerid.&amp;nbsp; If there can be more then modifiy the upper bound of _dropdates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;EDITTED NOTE:&amp;nbsp; I had originally forgotten to insert the multidata:'Y' option in the "h=_new_ hash ..." statement - even though I explicitly mentioned it in my comments.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;It's there now, which will eliminate the ERROR messages for "duplicate keys" and (more importantly) properly account for duplicate date's in the running 24-hr average calculations.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 17:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683490#M207036</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-09-14T17:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683498#M207043</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;What a beautiful piece of hash code, Mark. Thanks 1E+6!&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 07:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683498#M207043</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2020-09-13T07:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683505#M207046</link>
      <description>.  If there were a duplicate date, Just sum value as&lt;BR /&gt;&lt;BR /&gt;data sample;&lt;BR /&gt; set sample;&lt;BR /&gt; date=int(date);&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table temp as&lt;BR /&gt;select customerid,date,sum(value) as value&lt;BR /&gt; from sample&lt;BR /&gt;  group by  customerid,date;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;data sample;&lt;BR /&gt; set temp;&lt;BR /&gt;run;</description>
      <pubDate>Sun, 13 Sep 2020 10:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683505#M207046</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-09-13T10:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683534#M207057</link>
      <description>&lt;P&gt;Thank you for responding.&amp;nbsp; I queried the transactions table and found, for the month of August, there are over 2 million distinct accounts with over 60 million transactions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that is too much, I would be more than happy doing a subset, a weeks worth, or only certain types of accounts. I work in financial services and we have a fraud mitigation tool that uses these moving averages (24 hours, 3 days, 7 days, 30 days) but the data is 'live' and constantly updates as customers transact, so it isn't available to us to use for ex post insights into how well rules are performing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That being said, I would like to replicate this functionality in SAS so I can run simulations of rules over past data to see the rule performance based on different adjustments or scenarios.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 20:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683534#M207057</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-13T20:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683535#M207058</link>
      <description>&lt;P&gt;Thank you for taking the time to help my understanding of the hash object. I will attempt to apply this solution to my data and check back in.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 21:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683535#M207058</guid>
      <dc:creator>Array_Mover</dc:creator>
      <dc:date>2020-09-13T21:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find a 24 hour moving average of transactions by account - Attempting with Hash Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683570#M207071</link>
      <description>&lt;P&gt;Here I start with 2 million accounts and 200 million observations.&lt;/P&gt;
&lt;P&gt;Splitting the table into 20 takes 30 seconds, and each of the 20 SORT+SQL steps takes 1.2 minutes, so the whole thing takes about 25 minutes on my machine (140 SAS sessions open atm).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data W.HAVE;
  VALUE=1;
  do DATE='01jan2020:0:0'dt to '31aug2020:23:59:59'dt by '06:00:00't;
    do ACCT =1 to 2e6;
      if ranuni(1) &amp;gt; .9 then output;
    end;
  end;
run;
       
data _null_;
  call execute('data ');
  do I=1 to 20;
   call execute (cat('W.TMP',I));
  end; 
  do I=1 to 20;
    call execute(ifc(I=1,';set W.HAVE;','else '));
    call execute (cat('if ',I-1,'e5 &amp;lt;= ACCT &amp;lt; ',I,'e5 then output W.TMP',I,';')); 
  end; 
run;    
 
data _null_;
  do I=1 to 20;
   call execute (cat('proc sort data=W.TMP',I,'; by ACCT DATE; run;                '));
   call execute ('proc sql; create table W.OUT as select a.*, mean(b.VALUE) as AVG ');
   call execute (cat('from W.TMP', I, ' a left join W.TMP', I, ' b                 '));
   call execute ('on a.ACCT=b.ACCT and b.DATE between a.DATE and a.DATE-3600*24    ');
   call execute ('group by a.ACCT, a.DATE, a.VALUE; quit;                          ');
   call execute ('proc append base=W.WANT data=W.OUT; run;                         ');
 end;
run;  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that library W is an SPDE library with parameters &lt;FONT face="courier new,courier"&gt;compress=binary partsize=1T&lt;/FONT&gt;, in order to reduce IO. There is never a good reason not to use SPDE to process large tables.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 06:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-a-24-hour-moving-average-of-transactions-by-account/m-p/683570#M207071</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-14T06:47:06Z</dc:date>
    </item>
  </channel>
</rss>

