<?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 Find latest date reported per year in a set of million+ rows over 10 year span in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-latest-date-reported-per-year-in-a-set-of-million-rows-over/m-p/907636#M358274</link>
    <description>&lt;P&gt;I have a set of data where I want to find the max date per year.&amp;nbsp; Somewhat like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table x as select&lt;/P&gt;&lt;P&gt;max(account_date) as last_day format date9.&lt;/P&gt;&lt;P&gt;from y&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the last date per year can vary so instead of grabbing the last date for the entire set, I want to subset by year.&amp;nbsp; The output would look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp; &amp;nbsp;MaxDate&lt;/P&gt;&lt;P&gt;2011&amp;nbsp; &amp;nbsp;10OCT2011&lt;/P&gt;&lt;P&gt;2012&amp;nbsp; &amp;nbsp;14NOV2012&lt;/P&gt;&lt;P&gt;2013&amp;nbsp; &amp;nbsp;31DEC2013&lt;/P&gt;&lt;P&gt;2014&amp;nbsp; &amp;nbsp;05JUL2014&lt;/P&gt;&lt;P&gt;2015&amp;nbsp; &amp;nbsp;31DEC2015&lt;/P&gt;&lt;P&gt;.... and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There has to be a simple way with a few lines of code vs many.&amp;nbsp; Any help would be appreciated!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 19:29:28 GMT</pubDate>
    <dc:creator>bssiders</dc:creator>
    <dc:date>2023-12-12T19:29:28Z</dc:date>
    <item>
      <title>Find latest date reported per year in a set of million+ rows over 10 year span</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-latest-date-reported-per-year-in-a-set-of-million-rows-over/m-p/907636#M358274</link>
      <description>&lt;P&gt;I have a set of data where I want to find the max date per year.&amp;nbsp; Somewhat like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table x as select&lt;/P&gt;&lt;P&gt;max(account_date) as last_day format date9.&lt;/P&gt;&lt;P&gt;from y&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the last date per year can vary so instead of grabbing the last date for the entire set, I want to subset by year.&amp;nbsp; The output would look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp; &amp;nbsp;MaxDate&lt;/P&gt;&lt;P&gt;2011&amp;nbsp; &amp;nbsp;10OCT2011&lt;/P&gt;&lt;P&gt;2012&amp;nbsp; &amp;nbsp;14NOV2012&lt;/P&gt;&lt;P&gt;2013&amp;nbsp; &amp;nbsp;31DEC2013&lt;/P&gt;&lt;P&gt;2014&amp;nbsp; &amp;nbsp;05JUL2014&lt;/P&gt;&lt;P&gt;2015&amp;nbsp; &amp;nbsp;31DEC2015&lt;/P&gt;&lt;P&gt;.... and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There has to be a simple way with a few lines of code vs many.&amp;nbsp; Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 19:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-latest-date-reported-per-year-in-a-set-of-million-rows-over/m-p/907636#M358274</guid>
      <dc:creator>bssiders</dc:creator>
      <dc:date>2023-12-12T19:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Find latest date reported per year in a set of million+ rows over 10 year span</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-latest-date-reported-per-year-in-a-set-of-million-rows-over/m-p/907638#M358276</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
&amp;nbsp; &amp;nbsp; class year;
&amp;nbsp; &amp;nbsp; var account_date;
&amp;nbsp; &amp;nbsp; output out=want max=maxdate;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This assumes you already have a variable named YEAR, if you don't that's easily fixed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 19:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-latest-date-reported-per-year-in-a-set-of-million-rows-over/m-p/907638#M358276</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-12T19:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Find latest date reported per year in a set of million+ rows over 10 year span</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-latest-date-reported-per-year-in-a-set-of-million-rows-over/m-p/907639#M358277</link>
      <description>&lt;P&gt;your the man!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 19:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-latest-date-reported-per-year-in-a-set-of-million-rows-over/m-p/907639#M358277</guid>
      <dc:creator>bssiders</dc:creator>
      <dc:date>2023-12-12T19:36:09Z</dc:date>
    </item>
  </channel>
</rss>

