<?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: How to Select Data with Newest Load Date? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830975#M328363</link>
    <description>&lt;P&gt;Untested since I can't see your data. But I think you want something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table subtable as
   select SBSCR_NBR
        , SUB_FST_NM
        , SUB_LST_NM
        , LOAD_DT
   from MEMBERTBL
   having max(LOAD_DT) = LOAD_DT;
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Aug 2022 18:55:11 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-08-29T18:55:11Z</dc:date>
    <item>
      <title>How to Select Data with Newest Load Date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830973#M328362</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am looking to create some code that pulls only the newest SBSCR_NBR, SUB_FST_NM, and SUB_LST_NM based on the newest LOAD_DT (Date9. format). SBSCR_NBR should be unique, but sometimes people have multiple names in the system (i.e.: Jim/James, Bob/Robert for first name, and last names can change if maiden names change). Having multiple instances of SUB_FST_NM, and SUB_LST_NM included in this table causes duplicates in the data that I am joining to. Can someone help me figure this one out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CREATE TABLE subtable AS&lt;/P&gt;&lt;P&gt;SELECT DISTINCT SBSCR_NBR&lt;/P&gt;&lt;P&gt;,SUB_FST_NM&lt;/P&gt;&lt;P&gt;,SUB_LST_NM&lt;/P&gt;&lt;P&gt;,LOAD_DT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FROM MEMBERTBL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHERE RCD in ("EM");&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 18:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830973#M328362</guid>
      <dc:creator>supersasnewbie</dc:creator>
      <dc:date>2022-08-29T18:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select Data with Newest Load Date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830975#M328363</link>
      <description>&lt;P&gt;Untested since I can't see your data. But I think you want something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table subtable as
   select SBSCR_NBR
        , SUB_FST_NM
        , SUB_LST_NM
        , LOAD_DT
   from MEMBERTBL
   having max(LOAD_DT) = LOAD_DT;
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Aug 2022 18:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830975#M328363</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-29T18:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select Data with Newest Load Date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830977#M328365</link>
      <description>&lt;P&gt;I don't see where you have described the desired output. Newest load date ... according to what separation? Do you want newest load date by&amp;nbsp;&lt;SPAN&gt;SBSCR_NBR? You don't say that. Or do you want newest load date by some combination of&amp;nbsp;SUB_FST_NM and&amp;nbsp;SUB_LST_NM? Or do you want something else?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 18:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830977#M328365</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-29T18:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select Data with Newest Load Date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830986#M328368</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm looking for the newest load date by SBSCR_NBR. So for example, there could be data such as:&lt;BR /&gt;&lt;BR /&gt;LOAD_DT / SBSCR_NBR / SUB_FST_NM / SUB_LST_NM&lt;BR /&gt;05AUG2022 / 000001 / JAMES / DOE&lt;BR /&gt;01JUL2022 / 000001 / JIM / DOE&lt;BR /&gt;12DEC2011 / 000001 / JAMES / DOE&lt;BR /&gt;02AUG2022 / 000002 / RICK / THOMAS&lt;BR /&gt;01JUL2022 / 000002 / RICHARD / THOMAS&lt;BR /&gt;&lt;BR /&gt;Since there are two SBSCR_NBRs in this table, 000001 and 000002, with multiple variations of names, I'm looking to create a table only with the latest dated version by SBSCR_NBRs. Ultimately, the end result should be a table with:&lt;BR /&gt;&lt;BR /&gt;LOAD_DT / SBSCR_NBR / SUB_FST_NM / SUB_LST_NM&lt;BR /&gt;05AUG2022 / 000001 / JAMES / DOE&lt;BR /&gt;02AUG2022 / 000002 / RICK / THOMAS&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Aug 2022 19:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830986#M328368</guid>
      <dc:creator>supersasnewbie</dc:creator>
      <dc:date>2022-08-29T19:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select Data with Newest Load Date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830988#M328369</link>
      <description>&lt;P&gt;Thanks. I think a slight modification to the code from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table subtable as
   select SBSCR_NBR
        , SUB_FST_NM
        , SUB_LST_NM
        , LOAD_DT
   from MEMBERTBL
   group by sbscr_nbr
   having max(LOAD_DT) = LOAD_DT;
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Aug 2022 19:42:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Select-Data-with-Newest-Load-Date/m-p/830988#M328369</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-29T19:42:21Z</dc:date>
    </item>
  </channel>
</rss>

