<?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 get maxdate and claimid in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18615#M2821</link>
    <description>The CLASS statement may have trouble when the data have very high cardinality.  I don’t know just how big that number is.  &lt;BR /&gt;
&lt;BR /&gt;
I’ve been counting AES lately by SOC HLGT and PT with several thousand AES with no problem, granted that ain’t millions.  When running on a multi processor system using CLASS instead of BY, MEANS/SUMMARY can produce astounding performance. &lt;BR /&gt;
&lt;BR /&gt;
I would not eschew CLASS just because I “think” it might not work, I would find out first.</description>
    <pubDate>Tue, 11 May 2010 11:27:29 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2010-05-11T11:27:29Z</dc:date>
    <item>
      <title>how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18607#M2813</link>
      <description>claimid           date                                   rownumber&lt;BR /&gt;
111               1/31/2010                                1&lt;BR /&gt;
111                2/28/2010                               2 &lt;BR /&gt;
111                3/31/2010                               3&lt;BR /&gt;
&lt;BR /&gt;
112                1/31/2010                                2&lt;BR /&gt;
112                3/31/2010                                1                     &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
how to get values like follows:&lt;BR /&gt;
111               3/31/2010                               3&lt;BR /&gt;
112               3/31/2010                               1&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
the req is to get the claimid for those dates which are latest and its rownumber</description>
      <pubDate>Mon, 10 May 2010 01:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18607#M2813</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-05-10T01:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18608#M2814</link>
      <description>Assuming that your table is not too very large, one way:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data claims;&lt;BR /&gt;
input claimid date mmddyy10. rownumber;&lt;BR /&gt;
format date date9.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
111 01/31/2010 1&lt;BR /&gt;
111 02/28/2010 2 &lt;BR /&gt;
111 03/31/2010 3&lt;BR /&gt;
112 1/31/2010 2&lt;BR /&gt;
112 3/31/2010 1 &lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=claims;&lt;BR /&gt;
by claimid descending date;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data latestclaims;&lt;BR /&gt;
   set claims;&lt;BR /&gt;
   by claimid;&lt;BR /&gt;
   if first.claimid;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print data=latestclaims;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 10 May 2010 01:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18608#M2814</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-05-10T01:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18609#M2815</link>
      <description>ArtC,&lt;BR /&gt;
 How to get this in proc Sql?&lt;BR /&gt;
&lt;BR /&gt;
Claimid for the latest date and its max row number?</description>
      <pubDate>Mon, 10 May 2010 01:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18609#M2815</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-05-10T01:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18610#M2816</link>
      <description>Try something like:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql;&lt;BR /&gt;
select claimid, date, rownumber &lt;BR /&gt;
   from claims&lt;BR /&gt;
      group by claimid&lt;BR /&gt;
         having date=max(date)&lt;BR /&gt;
   ;&lt;BR /&gt;
   quit;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 10 May 2010 05:45:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18610#M2816</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-05-10T05:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18611#M2817</link>
      <description>You may want to consider PROC SUMMARY's IDGROUP OUTPUT statement option.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc summary data=claims nway;&lt;BR /&gt;
   class claimid;&lt;BR /&gt;
   output out=claim2(drop=_:) idgroup(max(date) out(date rownumber)=);&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 10 May 2010 14:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18611#M2817</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-05-10T14:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18612#M2818</link>
      <description>SUMMARY requires sorting the data.  The most efficient approach my be data volume dependent.</description>
      <pubDate>Mon, 10 May 2010 23:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18612#M2818</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-05-10T23:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18613#M2819</link>
      <description>I really like Data_NULL_'s SUMMARY solution.  It has the added advantage of allowing the top n values through the IDGROUP.  Since the CLASS statement is being used the result is sorted on CLAIMID, but the incoming data need not be sorted.</description>
      <pubDate>Tue, 11 May 2010 00:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18613#M2819</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-05-11T00:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18614#M2820</link>
      <description>I missed the CLASS statement.  SASPhile will just have to experiment.  He often has large datasets, so a CLASS could either run out of memory and abort or use virtual memory and take a long time.</description>
      <pubDate>Tue, 11 May 2010 01:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18614#M2820</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-05-11T01:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to get maxdate and claimid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18615#M2821</link>
      <description>The CLASS statement may have trouble when the data have very high cardinality.  I don’t know just how big that number is.  &lt;BR /&gt;
&lt;BR /&gt;
I’ve been counting AES lately by SOC HLGT and PT with several thousand AES with no problem, granted that ain’t millions.  When running on a multi processor system using CLASS instead of BY, MEANS/SUMMARY can produce astounding performance. &lt;BR /&gt;
&lt;BR /&gt;
I would not eschew CLASS just because I “think” it might not work, I would find out first.</description>
      <pubDate>Tue, 11 May 2010 11:27:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-maxdate-and-claimid/m-p/18615#M2821</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-05-11T11:27:29Z</dc:date>
    </item>
  </channel>
</rss>

