<?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: Deduplicating based on most recent date/time in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32697#M7903</link>
    <description>You have a couple of options - one is to perform two sorts with ay BY ID DESCENDING DATE;  on the first sort and then followed with a SORT NODUPKEY EQUALS   and a BY ID;  statement.&lt;BR /&gt;
&lt;BR /&gt;
The other option is to again sort with ID DESCENDING DATE, and then use a SAS DATA step with a SET and a BY ID;  statement -- and use BY GROUP processing with IF FIRST.ID  processing to subset your input and only capture the first occurence of ID values.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument on this topic:&lt;BR /&gt;
&lt;BR /&gt;
data step by group processing site:sas.com</description>
    <pubDate>Fri, 18 Dec 2009 20:22:27 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-12-18T20:22:27Z</dc:date>
    <item>
      <title>Deduplicating based on most recent date/time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32696#M7902</link>
      <description>How do you deduplicate based on most recent date? I have duplicate IDs which may or may not have the same information from week to week. I want to retain information for each uniqe ID with the most recent time/date stamp (i.e, 12/8/2009  10:20:53 AM). Thanks.&lt;BR /&gt;
&lt;BR /&gt;
PROC SORT data=total;&lt;BR /&gt;
by date_time ID;&lt;BR /&gt;
run;&lt;BR /&gt;
PROC FREQ DATA = total noprint;&lt;BR /&gt;
by date_time;&lt;BR /&gt;
table ID/ out = ID_DUPS  (keep = date_time ID Count where = (Count &amp;gt; 1)) ;&lt;BR /&gt;
run;&lt;BR /&gt;
 PROC PRINT DATA = ID_DUPS;&lt;BR /&gt;
 run

Message was edited by: jcis</description>
      <pubDate>Fri, 18 Dec 2009 19:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32696#M7902</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-18T19:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Deduplicating based on most recent date/time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32697#M7903</link>
      <description>You have a couple of options - one is to perform two sorts with ay BY ID DESCENDING DATE;  on the first sort and then followed with a SORT NODUPKEY EQUALS   and a BY ID;  statement.&lt;BR /&gt;
&lt;BR /&gt;
The other option is to again sort with ID DESCENDING DATE, and then use a SAS DATA step with a SET and a BY ID;  statement -- and use BY GROUP processing with IF FIRST.ID  processing to subset your input and only capture the first occurence of ID values.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument on this topic:&lt;BR /&gt;
&lt;BR /&gt;
data step by group processing site:sas.com</description>
      <pubDate>Fri, 18 Dec 2009 20:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32697#M7903</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-18T20:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Deduplicating based on most recent date/time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32698#M7904</link>
      <description>Thanks! Will try that.</description>
      <pubDate>Fri, 18 Dec 2009 20:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32698#M7904</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-18T20:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Deduplicating based on most recent date/time</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32699#M7905</link>
      <description>Please consider consolidating the two current posts - they are very much related with the only difference being.....maybe....date versus date/time.</description>
      <pubDate>Fri, 18 Dec 2009 21:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deduplicating-based-on-most-recent-date-time/m-p/32699#M7905</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-18T21:46:53Z</dc:date>
    </item>
  </channel>
</rss>

