<?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 the row if last digit is 4 in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/852954#M37499</link>
    <description>&lt;P&gt;Or like this :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID Sample $;
cards;
1        00012
2        00034
3        00032
4        00124
5        00432
;
run;

data want;
 set have;
 where reverse(strip(Sample)) NOT =: '4';
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jan 2023 22:20:33 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2023-01-09T22:20:33Z</dc:date>
    <item>
      <title>delete the row if last digit is 4</title>
      <link>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/852946#M37497</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a datset which has 5digit numbers that ends with 2 or 4. I want to delete the entire row if the last digit is 4.&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sample&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 00012&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 00034&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 00032&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;00124&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;00432&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to delete the row which has the last digit 4. In the above example, I want to delete 00034 and 00124.&lt;/P&gt;&lt;P&gt;Can I do this in SAS to remove if the 5th digit is 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 21:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/852946#M37497</guid>
      <dc:creator>Smitha9</dc:creator>
      <dc:date>2023-01-09T21:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: delete the row if last digit is 4</title>
      <link>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/852948#M37498</link>
      <description>&lt;P&gt;If Sample is character then this should do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
  set Have;
  if substr(Sample,5,1) = '4' then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jan 2023 21:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/852948#M37498</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-01-09T21:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: delete the row if last digit is 4</title>
      <link>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/852954#M37499</link>
      <description>&lt;P&gt;Or like this :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID Sample $;
cards;
1        00012
2        00034
3        00032
4        00124
5        00432
;
run;

data want;
 set have;
 where reverse(strip(Sample)) NOT =: '4';
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 22:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/852954#M37499</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-09T22:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: delete the row if last digit is 4</title>
      <link>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/853037#M37510</link>
      <description>&lt;P&gt;If the variable in numeric, you would use the MOD function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if mod(sample,10)=4 then delete;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jan 2023 11:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/delete-the-row-if-last-digit-is-4/m-p/853037#M37510</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-10T11:28:25Z</dc:date>
    </item>
  </channel>
</rss>

