<?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: delete all the Geography from rows having zero sum Value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415453#M101895</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Post test data in the form of a datastep, within the body of the post, using the {i} code window.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2017 10:25:44 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-11-22T10:25:44Z</dc:date>
    <item>
      <title>delete all the Geography from rows having zero sum Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415440#M101891</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can anyone tell me how can i delete all the Geography from rows which are having zero value&amp;nbsp;while summing for that geography. There are&amp;nbsp;around 10,000 different Geographies in my dataset.&lt;/P&gt;&lt;P&gt;I have attached the excel file for reference.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 10:09:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415440#M101891</guid>
      <dc:creator>Sfzz</dc:creator>
      <dc:date>2017-11-22T10:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: delete all the Geography from rows having zero sum Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415444#M101893</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Geography$ Variable_Value;
datalines;
Geo00001 1
Geo00001 3
Geo00001 4
Geo00001 5
Geo00002 0
Geo00002 0
Geo00002 0
Geo00002 0
Geo00003 5
Geo00003 0
Geo00003 0
Geo00003 7
Geo00003 0
Geo00003 2
Geo00004 0
Geo00004 0
Geo00004 0
Geo00004 0
Geo00004 0
;

proc sort data=have;
	by Geography;
run;

/* Data set approach */
data want;
	set have(where=(Variable_Value ne 0));
	by Geography;
	if first.Geography then sum=0;
	else sum+Variable_Value;
	retain sum;
	if last.Geography;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Nov 2017 10:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415444#M101893</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-11-22T10:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: delete all the Geography from rows having zero sum Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415453#M101895</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Post test data in the form of a datastep, within the body of the post, using the {i} code window.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 10:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415453#M101895</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-22T10:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: delete all the Geography from rows having zero sum Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415461#M101897</link>
      <description>data have;
input Geography$8. Variable_Value;
datalines;
Geo00001	1
Geo00001	3
Geo00001	4
Geo00001	5
Geo00002	0
Geo00002	0
Geo00002	0
Geo00002	0
Geo00003	5
Geo00003	0
Geo00003	0
Geo00003	7
Geo00003	0
Geo00003	2
Geo00004	0
Geo00004	0
Geo00004	0
Geo00004	0
Geo00004	0
run;


proc sort data=have;by Geography descending Variable_Value;run;

data want ;
set have;
by  Geography ;

if first.Geography then t = 0;
t+Variable_Value;
if t ne 0;
drop t;
run;</description>
      <pubDate>Wed, 22 Nov 2017 10:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-all-the-Geography-from-rows-having-zero-sum-Value/m-p/415461#M101897</guid>
      <dc:creator>TarunKumar</dc:creator>
      <dc:date>2017-11-22T10:37:54Z</dc:date>
    </item>
  </channel>
</rss>

