<?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 first.last and last.id in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173812#M33356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need the output of&amp;nbsp;&amp;nbsp;&amp;nbsp; purge='n'&amp;nbsp; and&amp;nbsp; record having highest date with purge='p' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data purged;&lt;/P&gt;&lt;P&gt;input acc purge$ date ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;111&amp;nbsp; p 234&lt;/P&gt;&lt;P&gt;234&amp;nbsp; n 1333&lt;/P&gt;&lt;P&gt;1111 p 2345&lt;/P&gt;&lt;P&gt;2234 n 1333&lt;/P&gt;&lt;P&gt;1121 p 2334&lt;/P&gt;&lt;P&gt;2334 n 3233&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=purged;&lt;/P&gt;&lt;P&gt;by&amp;nbsp;&amp;nbsp; purge date ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data purgedorder;&lt;/P&gt;&lt;P&gt;set purged;&lt;/P&gt;&lt;P&gt;by&amp;nbsp; purge&amp;nbsp; date;* the following code is working fine.&lt;/P&gt;&lt;P&gt;*by date purge; * if my by statement like this,Need logic for this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if purge='n' then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;else if(last.purge=1 and last.date=1) then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Aug 2014 19:09:55 GMT</pubDate>
    <dc:creator>rajeshm</dc:creator>
    <dc:date>2014-08-24T19:09:55Z</dc:date>
    <item>
      <title>first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173812#M33356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need the output of&amp;nbsp;&amp;nbsp;&amp;nbsp; purge='n'&amp;nbsp; and&amp;nbsp; record having highest date with purge='p' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data purged;&lt;/P&gt;&lt;P&gt;input acc purge$ date ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;111&amp;nbsp; p 234&lt;/P&gt;&lt;P&gt;234&amp;nbsp; n 1333&lt;/P&gt;&lt;P&gt;1111 p 2345&lt;/P&gt;&lt;P&gt;2234 n 1333&lt;/P&gt;&lt;P&gt;1121 p 2334&lt;/P&gt;&lt;P&gt;2334 n 3233&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=purged;&lt;/P&gt;&lt;P&gt;by&amp;nbsp;&amp;nbsp; purge date ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data purgedorder;&lt;/P&gt;&lt;P&gt;set purged;&lt;/P&gt;&lt;P&gt;by&amp;nbsp; purge&amp;nbsp; date;* the following code is working fine.&lt;/P&gt;&lt;P&gt;*by date purge; * if my by statement like this,Need logic for this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if purge='n' then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;else if(last.purge=1 and last.date=1) then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2014 19:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173812#M33356</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2014-08-24T19:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173813#M33357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps easier with sql&amp;nbsp; &lt;/P&gt;&lt;P&gt;PROC SQL ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CREATE TABLE&amp;nbsp; selection AS&lt;/P&gt;&lt;P&gt;&amp;nbsp; SELECT a.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM purged&amp;nbsp; A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE a.purge&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR a.date = MAX( a.date )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;QUIT ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If course there is always a "but".&lt;/P&gt;&lt;P&gt;What should happen when 2 ACC have the max date?&lt;/P&gt;&lt;P&gt;The sql code above would select both.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2014 19:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173813#M33357</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-08-24T19:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173814#M33358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from purged&lt;/P&gt;&lt;P&gt;where purge='n'&lt;/P&gt;&lt;P&gt;union all&lt;/P&gt;&lt;P&gt;select * from purged&lt;/P&gt;&lt;P&gt;where purge='p'&lt;/P&gt;&lt;P&gt;having date=max(date);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2014 21:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173814#M33358</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-08-24T21:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173815#M33359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the help. please let me know&amp;nbsp; the logic in datastep only.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by&amp;nbsp; purge&amp;nbsp; date;* the following code is working fine.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by date purge; * if my by statement like this,Need logic for this&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;reason: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;mistakenly I sorted in the second way and struggled a lot to get the answer.I want to know whether can we get the result or not ,if we sorted in second way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 07:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173815#M33359</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2014-08-25T07:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173816#M33360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; purged;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; acc purge$ date;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;datalines&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;111&amp;nbsp; p 234&lt;BR /&gt;234&amp;nbsp; n 1333&lt;BR /&gt;1111 p 2345&lt;BR /&gt;2234 n 1333&lt;BR /&gt;1121 p 2334&lt;BR /&gt;2334 n 3233&lt;BR /&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;sort&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=purged;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; purge &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;descending&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; date;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; purgedorder;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; purged;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; purge;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; purge eq &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'n'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; first.purge &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;print&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 16:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173816#M33360</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-08-25T16:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173817#M33361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A little complex, but not terribly lengthy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by date purge end=done;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if purge='n' then output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else recno=_n_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain recno;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if done then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have point=recno;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; drop recno;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This assumes you need just one purged record.&amp;nbsp; If you need more than one (such as one per date), it can still be done.&amp;nbsp; But the question looks like you are asking for just one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 16:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173817#M33361</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-08-25T16:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173818#M33362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hash is also considered as Data Step implementation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; purged;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; acc purge$ date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;111&amp;nbsp; p 234&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;234&amp;nbsp; n 1333&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1111 p 2345&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2234 n 1333&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1121 p 2334&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2334 n 3233&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; _n_=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; hash h(ordered: &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'a'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.definekey(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'date'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.definedata(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'purge'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'acc'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'date'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.definedone();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; hiter hi(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'h'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; purged &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=last;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; purge=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'n'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; purge=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'p'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=h.replace();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; last &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=hi.last();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; rc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 19:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173818#M33362</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-08-25T19:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173819#M33363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select sum(purge='p') into :p_count from purged;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=purged;&lt;BR /&gt;by date purge;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want(drop=cnt);&lt;BR /&gt;set purged;&lt;BR /&gt;by date purge;&lt;BR /&gt;if purge='p' then cnt+1;&lt;BR /&gt;if purge='n' or (purge='p' and cnt=&amp;amp;p_count);&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 19:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173819#M33363</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-08-25T19:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173820#M33364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot. simply superb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mistakenly sorted in this order and could not get the answer. got the logic now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 04:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173820#M33364</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2014-08-26T04:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: first.last and last.id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173821#M33365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could u please answer this one.&amp;nbsp; &lt;/P&gt;&lt;P&gt;question:&amp;nbsp; sas has to create a value/invalue statements for the given dataset (cntlin option for dataset2format convertion).based on what, it is creating value/invalue statements or sas creating both value/invalue statements for the given dataset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="60693" __jive_macro_name="thread" class="jive_macro jive_macro_thread" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2014 09:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-last-and-last-id/m-p/173821#M33365</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2014-08-29T09:59:10Z</dc:date>
    </item>
  </channel>
</rss>

