<?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: Gropu by sum in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342540#M78549</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input ID Amount;
cards;
1 0
1 0
1 0
1 0
2 -100
2 0
2 100
2 0
3 0
3 100
3 200
;
run;
proc sql;
select *,case when min(amount)=0 and max(amount)=0 then 'Y' else 'N' end as flag
 from have
  group by id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Mar 2017 11:57:23 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-03-20T11:57:23Z</dc:date>
    <item>
      <title>Gropu by sum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342531#M78545</link>
      <description>&lt;P&gt;Hi , I've the below dataset and need the ID who has the amount as 0 throuhout the lifecycle of the ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ID Amount;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;1 0&lt;/P&gt;&lt;P&gt;1 0&lt;/P&gt;&lt;P&gt;1 0&lt;/P&gt;&lt;P&gt;1 0&lt;/P&gt;&lt;P&gt;2 -100&lt;/P&gt;&lt;P&gt;2 0&lt;/P&gt;&lt;P&gt;2 100&lt;/P&gt;&lt;P&gt;2 0&lt;/P&gt;&lt;P&gt;3 0&lt;/P&gt;&lt;P&gt;3 100&lt;/P&gt;&lt;P&gt;3 200&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Expected Output is ID : 1 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Any&amp;nbsp; help is appreciated.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 11:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342531#M78545</guid>
      <dc:creator>Reddi</dc:creator>
      <dc:date>2017-03-20T11:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Gropu by sum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342532#M78546</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;having sum(amount) = 0&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Mar 2017 11:18:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342532#M78546</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-03-20T11:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Gropu by sum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342537#M78547</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input ID Amount;
cards;
1 0
1 0
1 0
1 0
2 -100
2 0
2 100
2 0
3 0
3 100
3 200
;
run;
proc sql;
select distinct id
 from have
  group by id
   having min(amount)=0 and max(amount)=0;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Mar 2017 11:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342537#M78547</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-20T11:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Gropu by sum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342538#M78548</link>
      <description>&lt;P&gt;Actually i need to add another indicator variable showing Y if the condition mets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 11:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342538#M78548</guid>
      <dc:creator>Reddi</dc:creator>
      <dc:date>2017-03-20T11:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Gropu by sum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342540#M78549</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input ID Amount;
cards;
1 0
1 0
1 0
1 0
2 -100
2 0
2 100
2 0
3 0
3 100
3 200
;
run;
proc sql;
select *,case when min(amount)=0 and max(amount)=0 then 'Y' else 'N' end as flag
 from have
  group by id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Mar 2017 11:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342540#M78549</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-20T11:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Gropu by sum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342552#M78553</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;, your brain is really sharp &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 12:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gropu-by-sum/m-p/342552#M78553</guid>
      <dc:creator>Reddi</dc:creator>
      <dc:date>2017-03-20T12:36:09Z</dc:date>
    </item>
  </channel>
</rss>

