<?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 Character comparison using IF in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Character-comparison-using-IF/m-p/224858#M40377</link>
    <description>&lt;DIV&gt;Good evening !&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm trying to create a filter to select records that has M on the last position.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This fields has strings up to 8 characters long.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;By using&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;IF MY_FIELD =: 'M'&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;this would retrieve all records that start with M. How can i restrict the filter to the last character?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;any help is welcome ! thanks !&lt;/DIV&gt;</description>
    <pubDate>Wed, 09 Sep 2015 22:11:49 GMT</pubDate>
    <dc:creator>MainframeSAS</dc:creator>
    <dc:date>2015-09-09T22:11:49Z</dc:date>
    <item>
      <title>Character comparison using IF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-comparison-using-IF/m-p/224858#M40377</link>
      <description>&lt;DIV&gt;Good evening !&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm trying to create a filter to select records that has M on the last position.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This fields has strings up to 8 characters long.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;By using&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;IF MY_FIELD =: 'M'&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;this would retrieve all records that start with M. How can i restrict the filter to the last character?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;any help is welcome ! thanks !&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Sep 2015 22:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-comparison-using-IF/m-p/224858#M40377</guid>
      <dc:creator>MainframeSAS</dc:creator>
      <dc:date>2015-09-09T22:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Character comparison using IF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-comparison-using-IF/m-p/224862#M40378</link>
      <description>&lt;P&gt;Hi, you could try ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data x;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;input name :$10 @@;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;datalines;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;KAREEM&amp;nbsp;MARK&amp;nbsp;LIAM&amp;nbsp;MICHAEL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data last_m;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;set x;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;if left(reverse(name)) =: "M";&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data set LAST_M&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;Obs name&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;1 KAREEM&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;2 LIAM&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 22:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-comparison-using-IF/m-p/224862#M40378</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-09-09T22:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Character comparison using IF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-comparison-using-IF/m-p/224884#M40380</link>
      <description>&lt;P&gt;Or...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if substr(name, length(name), 1) = "M";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Sep 2015 02:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-comparison-using-IF/m-p/224884#M40380</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-09-10T02:14:31Z</dc:date>
    </item>
  </channel>
</rss>

