<?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: code for computing summation variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383952#M91612</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=WORK.QUERY_FOR_COUNTS MEAN SUM MAXDEC=2;
class sort_order;
var STATISTIC_ATTRIBUTE_VAL;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My guess is that's what s/he needs.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jul 2017 22:45:26 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-07-28T22:45:26Z</dc:date>
    <item>
      <title>code for computing summation variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383864#M91595</link>
      <description>&lt;P&gt;I tried the following code to sum STATISTIC_ATTRIBUTE_VAL if&amp;nbsp;SORT_ORDER is a certain value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TABS_counts ;
*set TABS_counts;
retain pos_sum;
IF SORT_ORDER = 1121 then do;
pos_sum=sum(pos_sum,STATISTIC_ATTRIBUTE_VAL);END;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output is a blank. What is the proper method to bring in&amp;nbsp;&lt;SPAN&gt;SORT_ORDER&amp;nbsp;and&amp;nbsp;STATISTIC_ATTRIBUTE_VAL&amp;nbsp; which are in created tables above? Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 19:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383864#M91595</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-07-28T19:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: code for computing summation variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383867#M91597</link>
      <description>&lt;P&gt;What exactly are you trying to do?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And why did you comment out the SET statement? That means you won't have any data to work with...is there a reason to not use proc means?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=tabs_count;
where sort_order = 1121;
var pos_sum;
output out=want sum=statistic_attribute_val;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154084"&gt;@capam&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I tried the following code to sum STATISTIC_ATTRIBUTE_VAL if&amp;nbsp;SORT_ORDER is a certain value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TABS_counts ;
*set TABS_counts;
retain pos_sum;
IF SORT_ORDER = 1121 then do;
pos_sum=sum(pos_sum,STATISTIC_ATTRIBUTE_VAL);END;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output is a blank. What is the proper method to bring in&amp;nbsp;&lt;SPAN&gt;SORT_ORDER&amp;nbsp;and&amp;nbsp;STATISTIC_ATTRIBUTE_VAL&amp;nbsp; which are in created tables above? Thanks.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 19:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383867#M91597</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-28T19:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: code for computing summation variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383902#M91604</link>
      <description>Reeza, thank you for the quick reply. proc means does provide some stats, however, I'm trying to sum up a column STATISTIC_ATTRIBUTE_VAL when SORT_ORDER matches different values.&lt;BR /&gt;Thanks for pointing me in the right direction. The code I used is:&lt;BR /&gt;&lt;BR /&gt;proc means data=WORK.QUERY_FOR_COUNTS MEAN SUM MAXDEC=2;&lt;BR /&gt;where SORT_ORDER = 1121;&lt;BR /&gt;var STATISTIC_ATTRIBUTE_VAL;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;capam</description>
      <pubDate>Fri, 28 Jul 2017 19:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383902#M91604</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-07-28T19:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: code for computing summation variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383950#M91611</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154084"&gt;@capam&lt;/a&gt; wrote:&lt;BR /&gt;Reeza, thank you for the quick reply. proc means does provide some stats, however, I'm trying to sum up a column STATISTIC_ATTRIBUTE_VAL when SORT_ORDER matches different values.&lt;BR /&gt;Thanks for pointing me in the right direction. The code I used is:&lt;BR /&gt;&lt;BR /&gt;proc means data=WORK.QUERY_FOR_COUNTS MEAN SUM MAXDEC=2;&lt;BR /&gt;where SORT_ORDER = 1121;&lt;BR /&gt;var STATISTIC_ATTRIBUTE_VAL;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;capam&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Still have not shown any starting data. Or a log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say "when SORT_ORDER matches different values". Is this supposed to matching values in another data set somewhere?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you may even want to show how you build WORK.QUERY_FOR_COUNTS. It may be that the input data to that set is actually what you want to sum from.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 22:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383950#M91611</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-07-28T22:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: code for computing summation variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383952#M91612</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=WORK.QUERY_FOR_COUNTS MEAN SUM MAXDEC=2;
class sort_order;
var STATISTIC_ATTRIBUTE_VAL;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My guess is that's what s/he needs.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 22:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-computing-summation-variable/m-p/383952#M91612</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-28T22:45:26Z</dc:date>
    </item>
  </channel>
</rss>

