<?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 Latest Claim date and amount in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689507#M209627</link>
    <description>&lt;P&gt;Hi I need help in extracting last claim date and corresponding claim amount&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;HAVE;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;policy_no&lt;/SPAN&gt;$ dt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;input amount$;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;informat&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dt&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;datetime.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dt&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;datetime.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;500&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21MAY2018&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;3000&amp;nbsp; &amp;nbsp; &amp;nbsp;22DEC2018&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;800&amp;nbsp; &amp;nbsp; &amp;nbsp; 01JAN2019&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp;550&amp;nbsp; &amp;nbsp; &amp;nbsp; 21MAY2017&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp;130&amp;nbsp; &amp;nbsp; &amp;nbsp; 05JUN2020&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA WANT&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;policy_no&amp;nbsp; &amp;nbsp; amount&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;date&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;22DEC2018&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;800&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01JAN2019&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 130&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05JUN2020&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2020 11:46:49 GMT</pubDate>
    <dc:creator>Solly7</dc:creator>
    <dc:date>2020-10-07T11:46:49Z</dc:date>
    <item>
      <title>Latest Claim date and amount</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689507#M209627</link>
      <description>&lt;P&gt;Hi I need help in extracting last claim date and corresponding claim amount&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;HAVE;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;policy_no&lt;/SPAN&gt;$ dt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;input amount$;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;informat&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dt&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;datetime.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dt&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;datetime.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;500&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21MAY2018&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;3000&amp;nbsp; &amp;nbsp; &amp;nbsp;22DEC2018&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;800&amp;nbsp; &amp;nbsp; &amp;nbsp; 01JAN2019&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp;550&amp;nbsp; &amp;nbsp; &amp;nbsp; 21MAY2017&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp;130&amp;nbsp; &amp;nbsp; &amp;nbsp; 05JUN2020&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA WANT&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;policy_no&amp;nbsp; &amp;nbsp; amount&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;date&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;22DEC2018&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;800&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01JAN2019&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 130&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05JUN2020&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 11:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689507#M209627</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2020-10-07T11:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Claim date and amount</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689511#M209630</link>
      <description>&lt;P&gt;Please test your data step code before posting, so we do not have to fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
input policy_no $ amount dt :date9.;
format dt date9.;
cards;
1     500        21MAY2018
1     3000     22DEC2018
2     800      01JAN2019
3     550      21MAY2017
3     130      05JUN2020
;

data want;
set have;
by policy_no dt; /* dt included here to force correct sort order */
if last.policy_no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Oct 2020 11:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689511#M209630</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-07T11:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Claim date and amount</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689525#M209632</link>
      <description>&lt;P&gt;Just to clarify for beginners&lt;/P&gt;
&lt;PRE&gt;by policy_no dt; /* dt included here to force correct sort order */&lt;/PRE&gt;
&lt;P&gt;The DT in the BY statement does not force or implicitly sort the data.&amp;nbsp; The DT ensures proper operation of the algorithm (i.e. business rule) because the DATA Step will ERROR: if the data are not in the expected sorted order.&amp;nbsp; A more precise comment might be&amp;nbsp; &lt;CODE&gt;/* dt included here to &lt;STRONG&gt;assert&lt;/STRONG&gt; correct sort order */&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 12:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689525#M209632</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-10-07T12:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Claim date and amount</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689526#M209633</link>
      <description>&lt;P&gt;Nice correction; after all I am not a native English speaker, and sometimes miss out on nuances.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 12:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-Claim-date-and-amount/m-p/689526#M209633</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-07T12:55:55Z</dc:date>
    </item>
  </channel>
</rss>

