<?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 SAS DI Studio - Sort by ID and Desc Date - Keep only 1 obs per ID (with most recent date) in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234903#M5952</link>
    <description>&lt;P&gt;I have a table that has ID, Code, and Date. Each ID can have multiple codes, each occurring on a different date. I only want the ID &amp;amp; Code for the most recent date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I do this?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Nov 2015 18:03:01 GMT</pubDate>
    <dc:creator>GregG</dc:creator>
    <dc:date>2015-11-16T18:03:01Z</dc:date>
    <item>
      <title>SAS DI Studio - Sort by ID and Desc Date - Keep only 1 obs per ID (with most recent date)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234903#M5952</link>
      <description>&lt;P&gt;I have a table that has ID, Code, and Date. Each ID can have multiple codes, each occurring on a different date. I only want the ID &amp;amp; Code for the most recent date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I do this?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 18:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234903#M5952</guid>
      <dc:creator>GregG</dc:creator>
      <dc:date>2015-11-16T18:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI Studio - Sort by ID and Desc Date - Keep only 1 obs per ID (with most recent date)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234907#M5953</link>
      <description>&lt;P&gt;Two (of many more perhaps) choices:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&amp;nbsp;First sort, like in your post title. The a new sort on ID alone, and nodupkey.&lt;/LI&gt;
&lt;LI&gt;Using Join transformation, Group By on ID, having date = max(date)&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 16 Nov 2015 18:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234907#M5953</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-11-16T18:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI Studio - Sort by ID and Desc Date - Keep only 1 obs per ID (with most recent date)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234912#M5955</link>
      <description>&lt;P&gt;Thank you! I was thinking about the double sort, but wasn't sure if the second sort would re-sort (and wipe out the first).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ended up going with the join transformation option instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 18:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234912#M5955</guid>
      <dc:creator>GregG</dc:creator>
      <dc:date>2015-11-16T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI Studio - Sort by ID and Desc Date - Keep only 1 obs per ID (with most recent date)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234918#M5956</link>
      <description>Happy to help &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;BR /&gt;But the double sort should be reliable. The PROC SORT doc states that NODUPKEY will keep the first row encountered for each by group. &lt;BR /&gt;What to chose is just matter of taste. The SQL alternative could perform better if your source table is stored in a powerful RDBMS server.</description>
      <pubDate>Mon, 16 Nov 2015 19:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-Studio-Sort-by-ID-and-Desc-Date-Keep-only-1-obs-per-ID/m-p/234918#M5956</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-11-16T19:57:46Z</dc:date>
    </item>
  </channel>
</rss>

