<?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: Delete last record conditionally in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590522#M169024</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;;&lt;/P&gt;
&lt;P&gt;Methinks you've misstated the problem, hence the confusion. As I understand now, what you meant is "Delete the last record in each BY group if its code is not A". If so:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;                                  
  format mydate date9.;                      
  input ln_no $ code $ mydate date9. ;       
  cards ;                                    
1123 C 1jun2018                              
1123 C 11jun2018                             
1123 A 15jun2018                             
1123 A 12jun2018                             
1123 R 9jun2018                              
1123 R 3jun2018                              
1123 A 3May2018                              
1123 C 12jun2017                             
1126 R 9jun2018                              
1126 R 3jun2018                              
1127 A 3May2018                              
1127 C 12jun2017                             
;                                            
run ;                                        
                                             
data want ;                                  
  set have ;                                 
  by ln_no ;                                 
  if last.ln_no and code ne "A" then delete ;
run ;                                        
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See if that serves you right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Sep 2019 18:25:37 GMT</pubDate>
    <dc:creator>hashman</dc:creator>
    <dc:date>2019-09-20T18:25:37Z</dc:date>
    <item>
      <title>Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590495#M169006</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mydate &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ln_no $ code $ mydate &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1123 C 1jun2018&lt;/P&gt;
&lt;P&gt;1123 C 11jun2018&lt;/P&gt;
&lt;P&gt;1123 A 15jun2018&lt;/P&gt;
&lt;P&gt;1123 A 12jun2018&lt;/P&gt;
&lt;P&gt;1123 R 9jun2018&lt;/P&gt;
&lt;P&gt;1123 R 3jun2018&lt;/P&gt;
&lt;P&gt;1123 A 3May2018&lt;/P&gt;
&lt;P&gt;1123 C 12jun2017&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= have2; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ln_no &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;descending&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mydate;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;How can I delete the last record if the code is anything except an A.&amp;nbsp; So in this case I want to eliminate the 1123 C&amp;nbsp; 12jun2017 because the code does not equal A&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 17:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590495#M169006</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-09-20T17:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590499#M169010</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;                                                                                                                             
  format mydate date9.;                                                                                                                 
  input ln_no $ code $ mydate date9. ;                                                                                                  
  cards ;                                                                                                                               
1123 C 1jun2018                                                                                                                         
1123 C 11jun2018                                                                                                                        
1123 A 15jun2018                                                                                                                        
1123 A 12jun2018                                                                                                                        
1123 R 9jun2018                                                                                                                         
1123 R 3jun2018                                                                                                                         
1123 A 3May2018                                                                                                                         
1123 C 12jun2017                                                                                                                        
;                                                                                                                                       
run ;                                                                                                                                   
                                                                                                                                        
data want ;                                                                                                                             
  set have end = z ;                                                                                                                    
  if z and code ne "A" then delete ;                                                                                                    
run ;                        
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 17:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590499#M169010</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-20T17:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590500#M169011</link>
      <description>&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have2 end=eof;
if eof and code ne 'A' then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 17:53:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590500#M169011</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-20T17:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590504#M169013</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151"&gt;@Jagadishkatam&lt;/a&gt;&amp;nbsp; looks like the same answer has been provided by Guru PD &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 17:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590504#M169013</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-20T17:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590507#M169015</link>
      <description>&lt;P&gt;Alternatively with nobs option&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have2 nobs=nobs;
lastobs=nobs;
if _n_=lastobs and code ne 'A' then delete;
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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 17:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590507#M169015</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-20T17:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590508#M169016</link>
      <description>Yes I did not check that answer and when i posted it was same, now i changed the answer with nobs option.</description>
      <pubDate>Fri, 20 Sep 2019 18:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590508#M169016</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-20T18:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590510#M169018</link>
      <description>Lets say I have multiple entries by  number like this&lt;BR /&gt;data have ;                                                                                                                             &lt;BR /&gt;  format mydate date9.;                                                                                                                 &lt;BR /&gt;  input ln_no $ code $ mydate date9. ;                                                                                                  &lt;BR /&gt;  cards ;                                                                                                                               &lt;BR /&gt;1123 C 1jun2018                                                                                                                         &lt;BR /&gt;1123 C 11jun2018                                                                                                                        &lt;BR /&gt;1123 A 15jun2018                                                                                                                        &lt;BR /&gt;1123 A 12jun2018                                                                                                                        &lt;BR /&gt;1123 R 9jun2018                                                                                                                         &lt;BR /&gt;1123 R 3jun2018                                                                                                                         &lt;BR /&gt;1123 A 3May2018                                                                                                                         &lt;BR /&gt;1123 C 12jun2017 &lt;BR /&gt;1126 R 9jun2018                                                                                                                         &lt;BR /&gt;1126 R 3jun2018                                                                                                                         &lt;BR /&gt;1127 A 3May2018                                                                                                                         &lt;BR /&gt;1127 C 12jun2017 &lt;BR /&gt;;                                                                                                                                       &lt;BR /&gt;run ;                                                                                                                                   &lt;BR /&gt;                                                                                                                                        &lt;BR /&gt;data want ;                                                                                                                             &lt;BR /&gt;  set have end = z ;                                                                                                                    &lt;BR /&gt;  if z and code ne "A" then delete ;                                                                                                    &lt;BR /&gt;run ;    &lt;BR /&gt;Can the code be modified to accomplish the same delete of the last record based on number if it is not an A</description>
      <pubDate>Fri, 20 Sep 2019 18:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590510#M169018</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-09-20T18:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590513#M169020</link>
      <description>I should have used multiple numbers in my example.  Can I accomplish the same thing if I have multiple ln_no&lt;BR /&gt;data have ;                                                                                                                             &lt;BR /&gt;  format mydate date9.;                                                                                                                 &lt;BR /&gt;  input ln_no $ code $ mydate date9. ;                                                                                                  &lt;BR /&gt;  cards ;                                                                                                                               &lt;BR /&gt;1123 C 1jun2018                                                                                                                         &lt;BR /&gt;1123 C 11jun2018                                                                                                                        &lt;BR /&gt;1123 A 15jun2018                                                                                                                        &lt;BR /&gt;1123 A 12jun2018                                                                                                                        &lt;BR /&gt;1123 R 9jun2018                                                                                                                         &lt;BR /&gt;1123 R 3jun2018                                                                                                                         &lt;BR /&gt;1123 A 3May2018                                                                                                                         &lt;BR /&gt;1123 C 12jun2017 &lt;BR /&gt;1126 R 9jun2018                                                                                                                         &lt;BR /&gt;1126 R 3jun2018                                                                                                                         &lt;BR /&gt;1127 A 3May2018                                                                                                                         &lt;BR /&gt;1127 C 12jun2017 &lt;BR /&gt;;                                                                                                                                       &lt;BR /&gt;run ;                                                                                                                                   &lt;BR /&gt;                                                                                                                                        &lt;BR /&gt;data want ;                                                                                                                             &lt;BR /&gt;  set have end = z ;                                                                                                                    &lt;BR /&gt;  if z and code ne "A" then delete ;                                                                                                    &lt;BR /&gt;run ;</description>
      <pubDate>Fri, 20 Sep 2019 18:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590513#M169020</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-09-20T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590514#M169021</link>
      <description>Yes just replace the code ne "A" with the numeric variable and its value</description>
      <pubDate>Fri, 20 Sep 2019 18:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590514#M169021</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-20T18:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590516#M169022</link>
      <description>Did not understand your answer. In this case I want to eliminate the last entry which works in your code you sent however I want to also eliminate 1126 R 9jun2018 &lt;BR /&gt;1126 R 3jun2018  because netiher has a code of A.  Also eliminate 1123 C 12jun2017  because it was not preceeded by a code of A,  FInally I want to eliminate 1123 C 1jun2018  because it was not preceeded by a code of A</description>
      <pubDate>Fri, 20 Sep 2019 18:10:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590516#M169022</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-09-20T18:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590522#M169024</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;;&lt;/P&gt;
&lt;P&gt;Methinks you've misstated the problem, hence the confusion. As I understand now, what you meant is "Delete the last record in each BY group if its code is not A". If so:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;                                  
  format mydate date9.;                      
  input ln_no $ code $ mydate date9. ;       
  cards ;                                    
1123 C 1jun2018                              
1123 C 11jun2018                             
1123 A 15jun2018                             
1123 A 12jun2018                             
1123 R 9jun2018                              
1123 R 3jun2018                              
1123 A 3May2018                              
1123 C 12jun2017                             
1126 R 9jun2018                              
1126 R 3jun2018                              
1127 A 3May2018                              
1127 C 12jun2017                             
;                                            
run ;                                        
                                             
data want ;                                  
  set have ;                                 
  by ln_no ;                                 
  if last.ln_no and code ne "A" then delete ;
run ;                                        
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See if that serves you right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 18:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590522#M169024</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-20T18:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590523#M169025</link>
      <description>use first/last.&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by ln_no;&lt;BR /&gt;&lt;BR /&gt;if last.ln_no and code ='C' then delete;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 20 Sep 2019 18:26:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590523#M169025</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-20T18:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete last record conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590560#M169038</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mydate &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ln_no $ code $ mydate &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1123 C 1jun2018&lt;/P&gt;
&lt;P&gt;1123 C 11jun2018&lt;/P&gt;
&lt;P&gt;1123 A 15jun2018&lt;/P&gt;
&lt;P&gt;1123 A 12jun2018&lt;/P&gt;
&lt;P&gt;1123 R 9jun2018&lt;/P&gt;
&lt;P&gt;1123 R 3jun2018&lt;/P&gt;
&lt;P&gt;1123 A 3May2018&lt;/P&gt;
&lt;P&gt;1123 C 12jun2017&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= have2; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ln_no &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;descending&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mydate;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;How can I delete the last record if the code is anything except an A.&amp;nbsp; So in this case I want to eliminate the 1123 C&amp;nbsp; 12jun2017 because the code does not equal A&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Notice there is no example of the desired/ expected output. So we have to guess what you actually mean and with out changes in the first variable it can't be determined what the actual role of that variable would be in the solution.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 22:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-last-record-conditionally/m-p/590560#M169038</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-20T22:55:55Z</dc:date>
    </item>
  </channel>
</rss>

