<?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: Proc Means Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Means-Question/m-p/45545#M11979</link>
    <description>sbb, thanks for your reply.  yes, that was 'count'... sorry&lt;BR /&gt;
I meant 'include' all duplicate dept so that each dept would show up only once with one total in the report</description>
    <pubDate>Fri, 12 Sep 2008 14:42:13 GMT</pubDate>
    <dc:creator>KevinC_</dc:creator>
    <dc:date>2008-09-12T14:42:13Z</dc:date>
    <item>
      <title>Proc Means Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Means-Question/m-p/45543#M11977</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I am trying to use proc means to find the sum for sales amount for each dept.  The problem is each dept couuld be listed more than once with different sales amount.  I want to cound all of the 'duplicate' dept because that's how the data come in.  &lt;BR /&gt;
&lt;BR /&gt;
But the report is showing the sum for each 'duplicate' dept.  I would like to see one combined sum for all duplicate dept.  Can i do this with proc means?&lt;BR /&gt;
&lt;BR /&gt;
PROC MEANS MAXDEC=2 SUM NOPRINT; BY DEPT; VAR SALEAMT;&lt;BR /&gt;
OUTPUT OUT=C SUM = SALESUM;&lt;BR /&gt;
DATA D; SET C;&lt;BR /&gt;
FILE OUT;&lt;BR /&gt;
PUT @1    DEPT&lt;BR /&gt;
    @11   SALESUM PD7.2;&lt;BR /&gt;
&lt;BR /&gt;
Help Please ... Thank you</description>
      <pubDate>Fri, 12 Sep 2008 13:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Means-Question/m-p/45543#M11977</guid>
      <dc:creator>KevinC_</dc:creator>
      <dc:date>2008-09-12T13:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Means-Question/m-p/45544#M11978</link>
      <description>From what I understand, you want to "count" (do you mean combine together as one DEPT (DEPT='*DUPS*'; )???  &lt;BR /&gt;
&lt;BR /&gt;
Regardless, I believe you will need to pre-process your data file with a DATA step, as follows:&lt;BR /&gt;
&lt;BR /&gt;
1) sort SAS member input by DEPT, creating a temp file.&lt;BR /&gt;
2) use DATA step to input/output the temp file, and use FIRST.DEPT and LAST.DEPT to determine where there are multiples, and do something -- either combine these into a single DEPT value or establish a new "count" variable).&lt;BR /&gt;
3) sort your temp file in DEPT sequence.&lt;BR /&gt;
4) Use PROC MEANS, as you have shown in your code.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 12 Sep 2008 14:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Means-Question/m-p/45544#M11978</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-12T14:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Means-Question/m-p/45545#M11979</link>
      <description>sbb, thanks for your reply.  yes, that was 'count'... sorry&lt;BR /&gt;
I meant 'include' all duplicate dept so that each dept would show up only once with one total in the report</description>
      <pubDate>Fri, 12 Sep 2008 14:42:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Means-Question/m-p/45545#M11979</guid>
      <dc:creator>KevinC_</dc:creator>
      <dc:date>2008-09-12T14:42:13Z</dc:date>
    </item>
  </channel>
</rss>

