<?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 Removing row from data set after comparing with previous rows value in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73359#M7284</link>
    <description>For example:&lt;BR /&gt;
&lt;BR /&gt;
       Subscriber_Objid	   Account_ID   Contact_Objid	Contact_ID&lt;BR /&gt;
1.    268435459	   55                 268435457          56	&lt;BR /&gt;
2.    268435459	   NULL	        268435457	 NULL&lt;BR /&gt;
&lt;BR /&gt;
The second row should be removed.&lt;BR /&gt;
&lt;BR /&gt;
OR&lt;BR /&gt;
&lt;BR /&gt;
       Subscriber_Objid	   Account_ID   Contact_Objid	Contact_ID&lt;BR /&gt;
1.    268435459	   55                 268435457          56	&lt;BR /&gt;
2.    268435459	   56	        268435457	 NULL&lt;BR /&gt;
&lt;BR /&gt;
The second row should NOT be removed. because Account_id is not same for both rows.&lt;BR /&gt;
&lt;BR /&gt;
what i have to do ?&lt;BR /&gt;
&lt;BR /&gt;
1. i have to compare two rows of data set having same Contact_Objid(not nullable   column).&lt;BR /&gt;
2. if both rows I and J having same Contact_Objid then i have to delete I th row from data set if all other columns of i th rows are having either same value of j th row  or Null value.&lt;BR /&gt;
   &lt;BR /&gt;
please give me idea.....how can i implement .....i am thinking about lag function.&lt;BR /&gt;
&lt;BR /&gt;
is it possible complete all process in one data step...?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
    <pubDate>Tue, 10 Feb 2009 06:42:49 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-02-10T06:42:49Z</dc:date>
    <item>
      <title>Removing row from data set after comparing with previous rows value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73359#M7284</link>
      <description>For example:&lt;BR /&gt;
&lt;BR /&gt;
       Subscriber_Objid	   Account_ID   Contact_Objid	Contact_ID&lt;BR /&gt;
1.    268435459	   55                 268435457          56	&lt;BR /&gt;
2.    268435459	   NULL	        268435457	 NULL&lt;BR /&gt;
&lt;BR /&gt;
The second row should be removed.&lt;BR /&gt;
&lt;BR /&gt;
OR&lt;BR /&gt;
&lt;BR /&gt;
       Subscriber_Objid	   Account_ID   Contact_Objid	Contact_ID&lt;BR /&gt;
1.    268435459	   55                 268435457          56	&lt;BR /&gt;
2.    268435459	   56	        268435457	 NULL&lt;BR /&gt;
&lt;BR /&gt;
The second row should NOT be removed. because Account_id is not same for both rows.&lt;BR /&gt;
&lt;BR /&gt;
what i have to do ?&lt;BR /&gt;
&lt;BR /&gt;
1. i have to compare two rows of data set having same Contact_Objid(not nullable   column).&lt;BR /&gt;
2. if both rows I and J having same Contact_Objid then i have to delete I th row from data set if all other columns of i th rows are having either same value of j th row  or Null value.&lt;BR /&gt;
   &lt;BR /&gt;
please give me idea.....how can i implement .....i am thinking about lag function.&lt;BR /&gt;
&lt;BR /&gt;
is it possible complete all process in one data step...?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
      <pubDate>Tue, 10 Feb 2009 06:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73359#M7284</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-10T06:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row from data set after comparing with previous rows value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73360#M7285</link>
      <description>does the jth row follow the ith row or could the ith row and the jth row be any rows in the input file.</description>
      <pubDate>Tue, 10 Feb 2009 09:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73360#M7285</guid>
      <dc:creator>saroj</dc:creator>
      <dc:date>2009-02-10T09:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row from data set after comparing with previous rows value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73361#M7286</link>
      <description>thanks for giving time..&lt;BR /&gt;
here  j = i+1; &lt;BR /&gt;
&lt;BR /&gt;
comparison between jth and i th row will take place . and one will be deleted. if i th row is subset of jth row then ith will be deleted. else vise versa.</description>
      <pubDate>Tue, 10 Feb 2009 10:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73361#M7286</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-10T10:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row from data set after comparing with previous rows value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73362#M7287</link>
      <description>assuming you want just the last of equal groups of contact_objid and account_id, you could use by group processing (even if you need to add the notsorted option)&lt;BR /&gt;
[pre]data new_data ;&lt;BR /&gt;
  do until( last.contact_objid )  ;&lt;BR /&gt;
    set original ;&lt;BR /&gt;
     by account_id notsorted contact_objid notsorted ;&lt;BR /&gt;
  end ;&lt;BR /&gt;
run ;[/pre]However, this method depends on having actual Account_id rather than NULL.&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Tue, 10 Feb 2009 12:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73362#M7287</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-10T12:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row from data set after comparing with previous rows value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73363#M7288</link>
      <description>how about using two input statements in the datastep to read two rows per iteration and output and not output based on comparison output ?</description>
      <pubDate>Wed, 11 Feb 2009 04:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Removing-row-from-data-set-after-comparing-with-previous-rows/m-p/73363#M7288</guid>
      <dc:creator>saroj</dc:creator>
      <dc:date>2009-02-11T04:38:08Z</dc:date>
    </item>
  </channel>
</rss>

