<?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: Sum up in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139313#M261426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest way likely would be to use proc sql, though that is just what I prefer to go down columns. As long as you just want the aggregates of each of these groups the below code will work. Granted if you wanted to tack it on to the bottom of the file that the data came in from then you could not rename any of the variables and use union corr to the original dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select distinct items, count(unique(dept)) as c_dept, (sum(orders)) as s_orders, (sum(quantity)) as s_quan,&lt;/P&gt;&lt;P&gt;(sum(net_amount)) as s_net&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;group by items;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jan 2014 16:27:09 GMT</pubDate>
    <dc:creator>overmar</dc:creator>
    <dc:date>2014-01-13T16:27:09Z</dc:date>
    <item>
      <title>Sum up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139311#M261424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please Check the attached file. I need to sum up the columns as shown in the attached file&lt;/P&gt;&lt;P&gt;Please Guide me with various possible ways.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2014 15:47:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139311#M261424</guid>
      <dc:creator>Dipu</dc:creator>
      <dc:date>2014-01-13T15:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sum up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139312#M261425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC REPORT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2014 16:19:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139312#M261425</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-01-13T16:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sum up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139313#M261426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest way likely would be to use proc sql, though that is just what I prefer to go down columns. As long as you just want the aggregates of each of these groups the below code will work. Granted if you wanted to tack it on to the bottom of the file that the data came in from then you could not rename any of the variables and use union corr to the original dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select distinct items, count(unique(dept)) as c_dept, (sum(orders)) as s_orders, (sum(quantity)) as s_quan,&lt;/P&gt;&lt;P&gt;(sum(net_amount)) as s_net&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;group by items;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2014 16:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139313#M261426</guid>
      <dc:creator>overmar</dc:creator>
      <dc:date>2014-01-13T16:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sum up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139314#M261427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you output looks like a report, just use one of SAS's many reporting options.&lt;/P&gt;&lt;P&gt;You could even just use PROC PRINT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by Items;&lt;/P&gt;&lt;P&gt;&amp;nbsp; id Items ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var&amp;nbsp; Dept Orders Quantity Net_amount ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum Orders Quantity Net_amount;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2014 17:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-up/m-p/139314#M261427</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-01-13T17:15:45Z</dc:date>
    </item>
  </channel>
</rss>

