<?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: adding values with matching variable name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509313#M136908</link>
    <description>&lt;P&gt;I think you are after proc means/summary/sql&lt;/P&gt;</description>
    <pubDate>Wed, 31 Oct 2018 20:11:18 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-10-31T20:11:18Z</dc:date>
    <item>
      <title>adding values with matching variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509311#M136907</link>
      <description>&lt;P&gt;Hi, I have data with number of hours worked and county FIPS code. There are 3214 observations, and I want to add all the hours worked together for each county.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ctyhoursworked1;
set data;
keep hoursworked CountyC1;
run;
proc sort data=ctyhoursworked1 out=ctyhoursworked2 nodupkey;
by CountyC1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This gives me the number of observations in each county but does not add each observation value together. CSV file from the first command is attached.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 20:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509311#M136907</guid>
      <dc:creator>jesspurse</dc:creator>
      <dc:date>2018-10-31T20:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: adding values with matching variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509313#M136908</link>
      <description>&lt;P&gt;I think you are after proc means/summary/sql&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 20:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509313#M136908</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-31T20:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: adding values with matching variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509318#M136911</link>
      <description>&lt;P&gt;Get rid of NODUPKEY.&amp;nbsp; It will remove some observations, and you need all of the observations to add up the HOURSWORKED values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually get rid of the entire PROC SORT.&amp;nbsp; It isn't needed to add up numbers.&amp;nbsp; Here's a possibility:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have nway;&lt;/P&gt;
&lt;P&gt;var hoursworked;&lt;/P&gt;
&lt;P&gt;class CountyC1;&lt;/P&gt;
&lt;P&gt;output out=want (keep=CountyC1 total_hoursworked) sum=total_hoursworked;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 20:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509318#M136911</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-31T20:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: adding values with matching variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509332#M136917</link>
      <description>Thanks! This worked perfectly.</description>
      <pubDate>Wed, 31 Oct 2018 21:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-values-with-matching-variable-name/m-p/509332#M136917</guid>
      <dc:creator>jesspurse</dc:creator>
      <dc:date>2018-10-31T21:01:54Z</dc:date>
    </item>
  </channel>
</rss>

