<?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: Calculating the sum of two records and just keeping the sum record. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculating-the-sum-of-two-records-and-just-keeping-the-sum/m-p/781117#M248947</link>
    <description>&lt;P&gt;Or if you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table1;
   input armcode response count;
datalines;
1 1 0
1 2 1
2 1 0
2 2 0
;
run;

proc sql;
	select armcode, sum(count)
	from table1
	group by armcode
	order by armcode;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;BR /&gt;
&lt;TABLE class="table" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt; &lt;COL class="data" /&gt; &lt;COL class="data" /&gt; &lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="header" scope="colgroup"&gt;armcode&lt;/TH&gt;
&lt;TH class="header" scope="colgroup"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="b data"&gt;2&lt;/TD&gt;
&lt;TD class="b data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 20:20:10 GMT</pubDate>
    <dc:creator>HB</dc:creator>
    <dc:date>2021-11-18T20:20:10Z</dc:date>
    <item>
      <title>Calculating the sum of two records and just keeping the sum record.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-the-sum-of-two-records-and-just-keeping-the-sum/m-p/781108#M248941</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have armcd, response and their respective counts. I want to create a new value TOTAL by adding the counts of the responses (1,2).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="S_RAVI_0-1637262217871.png" style="width: 613px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65887i4F8BE61923406CBE/image-dimensions/613x144?v=v2" width="613" height="144" role="button" title="S_RAVI_0-1637262217871.png" alt="S_RAVI_0-1637262217871.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 19:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-the-sum-of-two-records-and-just-keeping-the-sum/m-p/781108#M248941</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2021-11-18T19:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the sum of two records and just keeping the sum record.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-the-sum-of-two-records-and-just-keeping-the-sum/m-p/781109#M248942</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
    class armcode;
    var count;
    output out=want sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Nov 2021 19:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-the-sum-of-two-records-and-just-keeping-the-sum/m-p/781109#M248942</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-18T19:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the sum of two records and just keeping the sum record.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-the-sum-of-two-records-and-just-keeping-the-sum/m-p/781117#M248947</link>
      <description>&lt;P&gt;Or if you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table1;
   input armcode response count;
datalines;
1 1 0
1 2 1
2 1 0
2 2 0
;
run;

proc sql;
	select armcode, sum(count)
	from table1
	group by armcode
	order by armcode;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;BR /&gt;
&lt;TABLE class="table" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt; &lt;COL class="data" /&gt; &lt;COL class="data" /&gt; &lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="header" scope="colgroup"&gt;armcode&lt;/TH&gt;
&lt;TH class="header" scope="colgroup"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="b data"&gt;2&lt;/TD&gt;
&lt;TD class="b data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 20:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-the-sum-of-two-records-and-just-keeping-the-sum/m-p/781117#M248947</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2021-11-18T20:20:10Z</dc:date>
    </item>
  </channel>
</rss>

