<?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: Create a table of column totals and append daily information in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566037#M159021</link>
    <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file is run daily so the dates denote the daily run. I am trying to build out an aggregated view where the new totals for the day would just be added as a column so i have a daily summary&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 20:35:22 GMT</pubDate>
    <dc:creator>TheNovice</dc:creator>
    <dc:date>2019-06-13T20:35:22Z</dc:date>
    <item>
      <title>Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566016#M159013</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I posted this earlier but not sure what happened with the message. I have data in the following format which is run daily&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;balance&lt;/TD&gt;&lt;TD&gt;bucket1&lt;/TD&gt;&lt;TD&gt;bucket2&lt;/TD&gt;&lt;TD&gt;bucket3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;TD&gt;10.00&lt;/TD&gt;&lt;TD&gt;20.00&lt;/TD&gt;&lt;TD&gt;70.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3456&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;TD&gt;10.00&lt;/TD&gt;&lt;TD&gt;20.00&lt;/TD&gt;&lt;TD&gt;70.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a worksheet that tracks the balances and count by column daily. SO output should be like. I know how to do it tomorrow using proc sql and sum function but is there a more efficient and faster method?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;01-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;02-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;balance&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;sum&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;01-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;02-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;balance&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;count&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 13 Jun 2019 20:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566016#M159013</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-13T20:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566021#M159014</link>
      <description>Where do the dates come from? How are the values calculated?</description>
      <pubDate>Thu, 13 Jun 2019 20:08:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566021#M159014</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-13T20:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566037#M159021</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file is run daily so the dates denote the daily run. I am trying to build out an aggregated view where the new totals for the day would just be added as a column so i have a daily summary&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 20:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566037#M159021</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-13T20:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566038#M159022</link>
      <description>I guess I'm not seeing a way I can know, and therefore tell the computer/program, how that data should be organized. It's quite easy to get reports in that format but how depends on the data structure. What you've shown is too generic, so the best answer right now is look into PROC REPORT and across variables. Or provide more details about your problem.</description>
      <pubDate>Thu, 13 Jun 2019 20:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566038#M159022</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-13T20:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566069#M159026</link>
      <description>&lt;P&gt;So, if i get the following file on Jan 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;balance&lt;/TD&gt;&lt;TD&gt;bucket1&lt;/TD&gt;&lt;TD&gt;bucket2&lt;/TD&gt;&lt;TD&gt;bucket3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;TD&gt;10.00&lt;/TD&gt;&lt;TD&gt;20.00&lt;/TD&gt;&lt;TD&gt;70.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3456&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;TD&gt;10.00&lt;/TD&gt;&lt;TD&gt;20.00&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;70.00&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I need 2 summaries like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;01-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;02-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;balance&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;200&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;20&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;40&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;140&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;01-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;02-Jan&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;balance&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;bucket3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Then on Jan 2 I would run the same report and attach to above. So on and so forth...&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 21:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566069#M159026</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-13T21:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566071#M159028</link>
      <description>Bad practice, IMO. Take your main data above, insert into a table that has full data and then run your report on the full data again. I suppose you could run summaries each day, but again that structure isn't recommended, that's for reporting. So it would still be a long file and then you'd report of it.</description>
      <pubDate>Thu, 13 Jun 2019 21:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566071#M159028</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-13T21:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566075#M159029</link>
      <description>&lt;P&gt;Thank you Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no choice. The table is refreshed daily and we need a summary of the daily snapshot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I don't know how to best proceed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I would do the following:&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table have as&amp;nbsp;&lt;/P&gt;&lt;P&gt;select sum(balance),sum(bucket1),sum(bucket2)&lt;/P&gt;&lt;P&gt;from table a&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then proc transpose the above to get it in the format I want but I feel like there is a better way. I just don't know it and can't seem to figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 22:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566075#M159029</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-13T22:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566077#M159031</link>
      <description>Is your final format required a table or report?&lt;BR /&gt;Have you tried basic PROC MEANS?</description>
      <pubDate>Thu, 13 Jun 2019 22:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566077#M159031</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-13T22:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566078#M159032</link>
      <description>&lt;P&gt;A report tracking the totals by day.. The idea is to automate it so the code runs everyday and attaches that day's total to the report&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not tried proc means, will try it right now. It's something i haven't used before&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 22:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566078#M159032</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-13T22:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566080#M159034</link>
      <description>By report I mean a PDF, Excel or HTML document that gets emailed to someone. If that's not the case, proc means and append is all you likely need so your approach sounds right. You're not getting a whole lot of improvement by switching anything. The only room for improvement would be to switch it to a structure I've mentioned previously where the report is generated every day from scratch and you only maintain the raw data.</description>
      <pubDate>Thu, 13 Jun 2019 22:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566080#M159034</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-13T22:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566083#M159036</link>
      <description>&lt;P&gt;It would be Excel&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i tried proc means but I can't figure it out. this is how i am doing it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Proc sql;&lt;BR /&gt;create table Test as&lt;BR /&gt;select&lt;BR /&gt;sum(AR_BALANCE) as AR_BALANCE,&lt;BR /&gt;SUM(BUCKET_0) AS BUCKET_0,&lt;BR /&gt;SUM(BUCKET_1) AS BUCKET_1,&lt;BR /&gt;SUM(BUCKET_2) AS BUCKET_2,&lt;BR /&gt;SUM(BUCKET_3) AS BUCKET_3,&lt;BR /&gt;from atb.atb&lt;BR /&gt;;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC TRANSPOSE DATA=TEST OUT=TEST1;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would just have to run this everyday and then do a left join to the existing report?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 22:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566083#M159036</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-13T22:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566086#M159037</link>
      <description>&lt;P&gt;Also,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I rename the date1 variable to show as the current date ?Is this possible? I would just keep running the code and joining to this output every day....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_NAME_ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; date1&lt;BR /&gt;AR_BALANCE 4555947291.7&lt;BR /&gt;BUCKET_0 &amp;nbsp; &amp;nbsp;&amp;nbsp; 627673027.55&lt;BR /&gt;BUCKET_1 &amp;nbsp; &amp;nbsp; 182100256.65&lt;BR /&gt;BUCKET_2 &amp;nbsp; &amp;nbsp; 55872964.12&lt;BR /&gt;BUCKET_3 &amp;nbsp; &amp;nbsp; 32185457.8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 23:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566086#M159037</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-13T23:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566098#M159043</link>
      <description>No, if it's going to Excel then use a report. &lt;BR /&gt;&lt;BR /&gt;1. do a proc means on the data&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;2. APPEND the results with the date to your summary table (PROC APPEND). &lt;BR /&gt;&lt;BR /&gt;3. Use PROC TABULATE or PROC REPORT to create the report and use ODS excel to export it straight to an Excel file&lt;BR /&gt;&lt;BR /&gt;4. If you're getting bored, learn how to have it sent of f via email at the end of the job automatically. &lt;BR /&gt;&lt;BR /&gt;If you're willing to restructure your process, you take the input data, append it to the main data set (proc append), then run proc tabulate straight to excel and email. Saves you two steps or so and usually a lot of error checking. &lt;BR /&gt;</description>
      <pubDate>Fri, 14 Jun 2019 02:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566098#M159043</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-14T02:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566267#M159104</link>
      <description>&lt;P&gt;Thank you, I am on track... is there a way to count with Proc means ? or should i just proc sql for that ?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 19:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566267#M159104</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-14T19:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566278#M159109</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/248692"&gt;@TheNovice&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, I am on track... is there a way to count with Proc means ? or should i just proc sql for that ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Count what?&lt;/P&gt;
&lt;P&gt;The N statistic returns the number of records of a variable that are not missing , which would generally &amp;nbsp;"count" the number of something, The NMISS statistic "counts" the number of missing values of a variable.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 20:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566278#M159109</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-14T20:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566761#M159349</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how far I got...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data atb1(drop=i);&lt;BR /&gt;set atb;&amp;nbsp;&lt;BR /&gt;array testzero(*) AR_BALANCE AGE_BUCKET_0 AGE_BUCKET_1_30 AGE_BUCKET_31_60 AGE_BUCKET_61_90&lt;BR /&gt;age_bucket_91_120 age_bucket_121_150 age_bucket_151_plus;&lt;BR /&gt;do i = 1 to dim(testzero);&lt;BR /&gt;if testzero(i)=0 then testzero(i)=.;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PROC MEANS DATA=ATB1 NOPRINT ;&lt;BR /&gt;id date;&lt;BR /&gt;VAR AR_BALANCE AGE_BUCKET_0 AGE_BUCKET_1_30 AGE_BUCKET_31_60 AGE_BUCKET_61_90&lt;BR /&gt;age_bucket_91_120 age_bucket_121_150 age_bucket_151_plus;&lt;BR /&gt;OUTPUT OUT=ATB2 (drop= _TYPE_ _FREQ_) SUM= N= / autoname ;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC TRANSPOSE DATA=ATB2 OUT = ATB3&lt;BR /&gt;prefix = date;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output i get is this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;_NAME_&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;_LABEL_&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;date1&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AR_BALANCE_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AR_BALANCE&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4,517,795,437&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_0_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_0&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 575,298,949&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_1_30_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_1_30&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 190,827,228&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_31_60_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_31_60&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 58,694,576&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_61_90_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_61_90&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32,294,689&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_91_120_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_91_120&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29,674,161&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_121_150_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_121_150&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 25,597,435&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_151_PLUS_Sum&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_151_PLUS&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3,674,579,799&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AR_BALANCE_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AR_BALANCE&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8,610,964&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_0_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_0&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3,445,686&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_1_30_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_1_30&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1,188,699&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_31_60_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_31_60&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 396,280&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_61_90_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_61_90&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 180,639&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_91_120_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_91_120&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 142,042&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_121_150_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_121_150&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 130,128&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_151_PLUS_N&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;AGE_BUCKET_151_PLUS&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4,366,092&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to proceed further. I can't figure out how to use Proc tabulate so I can keep appending the 3rd column every day to this data. The column should be dated...&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 01:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566761#M159349</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-18T01:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566777#M159353</link>
      <description>Figure it out for a single month first. Add in the date to that using a data and then use PROC APPEND to append the results. Then you can use PROC REPORT or TABULATE to flip it.</description>
      <pubDate>Tue, 18 Jun 2019 04:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566777#M159353</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-18T04:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566782#M159355</link>
      <description>&lt;P&gt;Why is it so hard to get noobs to post their question in the form of a self-contained have/want data step?&amp;nbsp; Why do you expect us to convert your sample data into working code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Forum admins, when someone creates a new account, can you send them an email, or at least redirect them to a link, that directs them how to ask a question?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, after expending the effort in converting the cut-and-paste job from your original post into a working data step, this is what I've got so far.&amp;nbsp; It's incomplete, but since you haven't been clear in asking your question, perhaps you can run with this and finish it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to add loaddate to your data - the code can't magically know what data belongs to what loaddate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* How do you derive count?&lt;/P&gt;
&lt;P&gt;* Does ID have any relevance to what you're doing?&lt;/P&gt;
&lt;P&gt;* How do you want to name your columns?&amp;nbsp; Do they have to be SAS V7 column name compliant, or are you happy with name literals and all that entails?&amp;nbsp; See &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p18cdcs4v5wd2dn1q0x296d3qek6.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p18cdcs4v5wd2dn1q0x296d3qek6.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID : 4. bucket1-bucket3 : 5.2 loaddate : date9.;
format bucket: 5.2 loaddate date9.;
datalines;
1234   10.00   20.00   70.00   01JAN2019
3456   10.00   20.00   70.00   01JAN2019
1234   10.00   20.00   70.00   02JAN2019
3456   10.00   20.00   70.00   02JAN2019
1234   10.00   20.00   70.00   03JAN2019
3456   10.00   20.00   70.00   03JAN2019
;
run;

data dates;
   do loaddate="01JAN2019"d to "31DEC2019"d;
      output;
   end;
   format loaddate date9.;
run;

data source;
   merge have dates;
   by loaddate;
run;

proc summary data=source missing;
   by loaddate;
   var bucket:;
   output out=totals (drop=_type_ _freq_) sum= n= / autoname;
run;

options validvarname=any;

* I don't know why the output does not have the loaddate (eg. 01JAN2019) as the column label ;
* I'm running SAS 9.3 and EG 7.x;
* Perhaps it will work properly for you??? ;
proc transpose data=totals out=sums;
   idlabel loaddate;
run;

data want;
   set sums;
   array totals{*} COL:;
   totals_bucket=0;
   do i=1 to dim(totals);
      label=vlabel(totals{i});
      putlog label=;
      * bail on first missing column ;
      if missing(totals{i}) then leave;
      totals_bucket+totals{i};
      totals{i}=totals_bucket;
   end;
   drop totals: i;
run;

* Compare with the above output ;
proc transpose data=totals out=sums2;
   id loaddate;
run;

data want2;
   set sums2;
   array totals{*} '01JAN2019'n--'31DEC2019'n;
   totals_bucket=0;
   do i=1 to dim(totals);
      label=vlabel(totals{i});
      putlog label=;
      * bail on first missing column ;
      if missing(totals{i}) then leave;
      totals_bucket+totals{i};
      totals{i}=totals_bucket;
   end;
   drop totals: i;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 04:40:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566782#M159355</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-06-18T04:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566923#M159389</link>
      <description>&lt;P&gt;Thank you Scott,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This noob doesn't know much. I have been teaching SAS myself and it's been a bit tough. That being said, I appreciate your bluntness and direction. Moving forward, I will post as you suggested. I haven't before but no one has said otherwise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will look at your response today and try to work it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 15:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566923#M159389</guid>
      <dc:creator>TheNovice</dc:creator>
      <dc:date>2019-06-18T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table of column totals and append daily information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566949#M159396</link>
      <description>&lt;P&gt;Here's a fully worked example, which assumes you import the data every day correctly already into a data set called have. Then every day you would call the %addData macro and %createReport macro to generate your report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should probably verify a few things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Path to where you'll store the reportingData set permanently&lt;/P&gt;
&lt;P&gt;2. You should add some protection so reportingData cannot easily be accidentally deleted&lt;/P&gt;
&lt;P&gt;3. You should add some verification to ensure you don't load the same data twice, ie if something errors out you may have to remove that dates record first and then add it back in.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. Error checking for parameters in the macro to exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this should get you started and going. The code is somewhat commented so please read the comments to help you understand what each step is doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input ID : 4. bucket1-bucket3 : 5.2;
	format bucket: 5.2;
	datalines;
1234   10.00   20.00   70.00 
3456   10.00   20.00   70.00
1234   10.00   20.00   70.00
3456   10.00   20.00   70.00
1234   10.00   20.00   70.00
3456   10.00   20.00   70.00
;
run;

%macro addData(dsin=);
	*should add a check to ensure data has not been loaded already;
	*calculate summary statistics;
	ods select none;

	proc means data=&amp;amp;dsin stackods n sum;
		class ID;
		var bucket:;
		ods output summary=_stats;
	run;

	ods select all;
	**add in load date;

	data _stats2;
		set _stats;
		loadDate=today();
		format loadDate date9.;
		rename N=Count SUM=TOtal;
		keep ID Variable N SUM loadDate;
	run;

	*add data to master data set each day;
	*this should go to a permanent library;
	libname myData '/home/fkhurshed/Demo1';

	proc append base=myData.reportingData data=_stats2 force;
	run;

	libname myData;
	*removes temporary tables, uncomment once you are sure how it works;
	*proc sql noprint;
	*drop table _stats _stats2;
	*quit;
%mend;

%macro createReport(path=);
	*creates Excel file with data;
	ods excel file="&amp;amp;path." style=meadow;
	*report data for counts data;
	title "Report for %sysfunc(today(), worddate.)";
	title2 "Counts";

	proc tabulate data=reportingData;
		class loadDate Variable;
		var Count;
		table Variable='', loadDate=''*Count=''*n='#'*f=8.0;
	run;

	*report data for sum data;
	title1;
	title2 "Sums";

	proc tabulate data=reportingData;
		class loadDate Variable;
		var TOtal;
		table Variable='', loadDate=''*Total=''*sum='Total $'*f=8.0;
	run;

	ods excel close;
%mend;

%addData(dsin=have);
%createReport(path=/home/fkhurshed/Demo.xlsx);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-table-of-column-totals-and-append-daily-information/m-p/566949#M159396</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-18T16:14:29Z</dc:date>
    </item>
  </channel>
</rss>

