<?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: Recognizing one variable, then sum in another row in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Recognizing-one-variable-then-sum-in-another-row/m-p/33773#M8188</link>
    <description>&amp;gt; Hi. I have a &lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; variable. X would in this test case be 13+12+12 = 27&lt;BR /&gt;
&lt;BR /&gt;
challenging &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc means&lt;BR /&gt;
will also provide class totals like&lt;BR /&gt;
proc means data= whatever nway  ;&lt;BR /&gt;
class name ;&lt;BR /&gt;
var value ;&lt;BR /&gt;
output sum= out= summary ;&lt;BR /&gt;
run ;&lt;BR /&gt;
proc print ;&lt;BR /&gt;
id name ;&lt;BR /&gt;
var value ;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 15 Nov 2010 13:30:05 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-11-15T13:30:05Z</dc:date>
    <item>
      <title>Recognizing one variable, then sum in another row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recognizing-one-variable-then-sum-in-another-row/m-p/33771#M8186</link>
      <description>Hi. I have a dataset that looks like this..&lt;BR /&gt;
&lt;BR /&gt;
Name      Value&lt;BR /&gt;
X             13&lt;BR /&gt;
X             12&lt;BR /&gt;
Y             44&lt;BR /&gt;
X             12&lt;BR /&gt;
Y             213&lt;BR /&gt;
Z             12&lt;BR /&gt;
Y             54&lt;BR /&gt;
&lt;BR /&gt;
But.. it's with approximatly 2000 different X,Y,Z....&lt;BR /&gt;
&lt;BR /&gt;
So what i would like SAS to do, is to recognize each specific X, and everytime it does so, add the "Value" variable. X would in this test case be 13+12+12 = 27 - output would thus look like:&lt;BR /&gt;
&lt;BR /&gt;
Name        Value&lt;BR /&gt;
X               27&lt;BR /&gt;
Y              311&lt;BR /&gt;
Z               12&lt;BR /&gt;
&lt;BR /&gt;
I've tryed to google it, but with no luck.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Mon, 15 Nov 2010 10:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recognizing-one-variable-then-sum-in-another-row/m-p/33771#M8186</guid>
      <dc:creator>TMorville</dc:creator>
      <dc:date>2010-11-15T10:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Recognizing one variable, then sum in another row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recognizing-one-variable-then-sum-in-another-row/m-p/33772#M8187</link>
      <description>I think i just made this work:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table g as&lt;BR /&gt;
select&lt;BR /&gt;
by,&lt;BR /&gt;
sum(VALUE) as branch_profit&lt;BR /&gt;
from c&lt;BR /&gt;
where by ne ' '&lt;BR /&gt;
group by NAME;&lt;BR /&gt;
quit;

Message was edited by: TMorville</description>
      <pubDate>Mon, 15 Nov 2010 10:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recognizing-one-variable-then-sum-in-another-row/m-p/33772#M8187</guid>
      <dc:creator>TMorville</dc:creator>
      <dc:date>2010-11-15T10:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Recognizing one variable, then sum in another row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Recognizing-one-variable-then-sum-in-another-row/m-p/33773#M8188</link>
      <description>&amp;gt; Hi. I have a &lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; variable. X would in this test case be 13+12+12 = 27&lt;BR /&gt;
&lt;BR /&gt;
challenging &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc means&lt;BR /&gt;
will also provide class totals like&lt;BR /&gt;
proc means data= whatever nway  ;&lt;BR /&gt;
class name ;&lt;BR /&gt;
var value ;&lt;BR /&gt;
output sum= out= summary ;&lt;BR /&gt;
run ;&lt;BR /&gt;
proc print ;&lt;BR /&gt;
id name ;&lt;BR /&gt;
var value ;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 15 Nov 2010 13:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Recognizing-one-variable-then-sum-in-another-row/m-p/33773#M8188</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-11-15T13:30:05Z</dc:date>
    </item>
  </channel>
</rss>

