<?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 function understanding in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442806#M110734</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Could you please clarify the meaning of "&lt;SPAN&gt;sums &lt;/SPAN&gt;&lt;EM&gt;one&lt;/EM&gt;&lt;SPAN&gt; variable &lt;/SPAN&gt;&lt;EM&gt;across observations&lt;/EM&gt;"?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Should have said "over several observations", as across might be misleading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also see &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473699.htm" target="_blank"&gt;this result&lt;/A&gt; of a google search for "sas sql summary functions".&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 09:20:29 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-03-06T09:20:29Z</dc:date>
    <item>
      <title>Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442781#M110726</link>
      <description>&lt;P&gt;Appreciate if someone of you help me understand the difference between the following two sum functions. I just wanted to know the difference between the two.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sum ('7101100000'n ,
         '7101100010'n ,
         '7101101000'n 
         ) as PREM_AMT&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;SUM('6131112300'n) AS SUM_of_6131112300&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442781#M110726</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-03-06T08:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442784#M110728</link>
      <description>&lt;P&gt;The first sums &lt;EM&gt;several&lt;/EM&gt; variables within a single row (observation), the second sums &lt;EM&gt;one&lt;/EM&gt; variable &lt;EM&gt;across observations&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442784#M110728</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-06T08:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442799#M110730</link>
      <description>&lt;P&gt;Could you please clarify the meaning of "&lt;SPAN&gt;sums &lt;/SPAN&gt;&lt;EM&gt;one&lt;/EM&gt;&lt;SPAN&gt; variable &lt;/SPAN&gt;&lt;EM&gt;across observations&lt;/EM&gt;"?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442799#M110730</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-03-06T08:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442804#M110733</link>
      <description>&lt;P&gt;VAR1&amp;nbsp; &amp;nbsp;VAR2&amp;nbsp; &amp;nbsp;VAR3&lt;/P&gt;
&lt;P&gt;abc&amp;nbsp; &amp;nbsp; &amp;nbsp; def&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ghi&lt;/P&gt;
&lt;P&gt;abc&amp;nbsp; &amp;nbsp; &amp;nbsp; def&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ghi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sum across observations means the value from one row of abc + def + ghi&lt;/P&gt;
&lt;P&gt;Sum column means all from one column abc + abc&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 09:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442804#M110733</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-06T09:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442806#M110734</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Could you please clarify the meaning of "&lt;SPAN&gt;sums &lt;/SPAN&gt;&lt;EM&gt;one&lt;/EM&gt;&lt;SPAN&gt; variable &lt;/SPAN&gt;&lt;EM&gt;across observations&lt;/EM&gt;"?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Should have said "over several observations", as across might be misleading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also see &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473699.htm" target="_blank"&gt;this result&lt;/A&gt; of a google search for "sas sql summary functions".&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 09:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442806#M110734</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-06T09:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442823#M110743</link>
      <description>&lt;P&gt;When you say "&lt;SPAN&gt;Sum column means all from one column abc + abc&lt;/SPAN&gt;", I will be getting the same value for all the observations if new variable VAR4 is being created?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 10:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442823#M110743</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-03-06T10:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442828#M110746</link>
      <description>&lt;P&gt;&lt;SPAN&gt;When you say "&lt;/SPAN&gt;&lt;SPAN&gt;over several observations&lt;/SPAN&gt;&lt;SPAN&gt;" whether I will be getting the same value for all the observations if new variable VAR4 is being created?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 10:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442828#M110746</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-03-06T10:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442832#M110748</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Just try it.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y;
cards;
1 2
3 4
5 6
;
run;

proc sql;
create table want1 as
select sum(x,y) as z
from have;
create table want2 as
select sum(x) as x, sum(y) as y
from have;
quit;

proc print data=want1 noobs;
run;
proc print data=want2 noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and look at the results.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 11:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442832#M110748</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-06T11:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function understanding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442994#M110798</link>
      <description>&lt;P&gt;History aside:&lt;/P&gt;
&lt;P&gt;SAS started in 1966 or thereabouts and started creating data step programming.&lt;/P&gt;
&lt;P&gt;SQL started a few years later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each had their own idea of "sum" because of how the two packages were used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Years later SAS incorporated the Proc SQL to have many of the features of SQL and hence used the SQL core features like SUM as an aggregate function across rows so existing SQL programs were easier to convert (and to not confuse SQL programmers).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that SUM in proc means, summary, tabulate, report and print are much like the aggregate Sum in proc sql if that helps any.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this issue of which is which comes up from occasional users of both paths.&lt;/P&gt;
&lt;P&gt;The computer world if rife with such "similarities". I learned one OS that used CAT for catalog (listing of files), UNIX didn't like that at all when I tried that when I was learning the little I know of Unix. {For non-Unix programmers CAT concatenates files, very different behavior}.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attention to detail and syntax guides are your friends.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 18:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-understanding/m-p/442994#M110798</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-06T18:23:35Z</dc:date>
    </item>
  </channel>
</rss>

