<?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: Help on data removal .. in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Help-on-data-removal/m-p/114425#M10157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murray,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This concepts are working properly. Thanks much for your help on this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kannan B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 18 Aug 2013 18:57:40 GMT</pubDate>
    <dc:creator>Baskarkannan</dc:creator>
    <dc:date>2013-08-18T18:57:40Z</dc:date>
    <item>
      <title>Help on data removal ..</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Help-on-data-removal/m-p/114423#M10155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Need help for below scenario&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data set as like below. I want to remove the members those who are in lapsed status from the data set&amp;nbsp; (i.e Where status = 1 in the latest date) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;option compress = yes;&lt;/P&gt;&lt;P&gt;data sample;&lt;/P&gt;&lt;P&gt;input member_id status change_date DDMMYY10.;&lt;/P&gt;&lt;P&gt;format change_date date9.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;123 2 10072013&lt;/P&gt;&lt;P&gt;123 3 18072013&lt;/P&gt;&lt;P&gt;123 1 03082013&lt;/P&gt;&lt;P&gt;456 1 08082013&lt;/P&gt;&lt;P&gt;456 2 17082013&lt;/P&gt;&lt;P&gt;789 3 14052013&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = sample;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In the above data set member_id 123 having 3 observations. The third observations 123 1 03082013 is the latest record also having status = 1 . So The member &lt;STRONG&gt;should not&lt;/STRONG&gt; come to the report. It needs to be eliminated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The member_id 456 having 2 observations. The second observations 456 2 17082013 is the latest record also having status = 2 . So The member should come to the report. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kannan B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 18:18:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Help-on-data-removal/m-p/114423#M10155</guid>
      <dc:creator>Baskarkannan</dc:creator>
      <dc:date>2013-08-18T18:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help on data removal ..</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Help-on-data-removal/m-p/114424#M10156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make this clear is it only the last instance of of a member where the status is examined, with all instances being deleted if lapsed and all being kept if not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, is it the last record with respect to time or with respect to position on the dataset? I notice that for 123 the change date on the last record occurs chronologically before the date on the previous two records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whatever the case then this program should help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* sort by member, and if necessary by date */&lt;/P&gt;&lt;P&gt;proc sort data=sample out=sample2;&lt;/P&gt;&lt;P&gt;by member_id, change_date;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* make list of member ids that fall within lapsed category*/&lt;/P&gt;&lt;P&gt;data exclsn_list;&lt;/P&gt;&lt;P&gt;set sample2;&lt;/P&gt;&lt;P&gt;by member_id; /*adds first and last automatic variables*/&lt;/P&gt;&lt;P&gt;if last.member_id AND status=1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*exclude based on our list */&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table clean_sample as&lt;/P&gt;&lt;P&gt;select * from sample&lt;/P&gt;&lt;P&gt;where member_id not in&lt;/P&gt;&lt;P&gt;(select member_id from exclsn_list)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* print result*/&lt;/P&gt;&lt;P&gt;proc print data=clean_sample;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 18:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Help-on-data-removal/m-p/114424#M10156</guid>
      <dc:creator>Murray_Court</dc:creator>
      <dc:date>2013-08-18T18:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help on data removal ..</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Help-on-data-removal/m-p/114425#M10157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murray,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This concepts are working properly. Thanks much for your help on this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kannan B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 18:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Help-on-data-removal/m-p/114425#M10157</guid>
      <dc:creator>Baskarkannan</dc:creator>
      <dc:date>2013-08-18T18:57:40Z</dc:date>
    </item>
  </channel>
</rss>

