<?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 specific characters from a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/specific-characters-from-a-string/m-p/443334#M282843</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to find the ID where the first 3 characters of the field are between (‘A’) and (‘Z’)...So if I have this list:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;5021060
A310603
D1A5421
5022000
5001050
5002000
5010020
5010045
5010045
50A5421
5012060
5013100

&lt;/PRE&gt;&lt;P&gt;then the SAS program would output only these:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A310603&lt;/P&gt;&lt;P&gt;D1A5421&lt;/P&gt;&lt;P&gt;50A5421&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 07 Mar 2018 15:04:14 GMT</pubDate>
    <dc:creator>serrld113</dc:creator>
    <dc:date>2018-03-07T15:04:14Z</dc:date>
    <item>
      <title>specific characters from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/specific-characters-from-a-string/m-p/443334#M282843</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to find the ID where the first 3 characters of the field are between (‘A’) and (‘Z’)...So if I have this list:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;5021060
A310603
D1A5421
5022000
5001050
5002000
5010020
5010045
5010045
50A5421
5012060
5013100

&lt;/PRE&gt;&lt;P&gt;then the SAS program would output only these:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A310603&lt;/P&gt;&lt;P&gt;D1A5421&lt;/P&gt;&lt;P&gt;50A5421&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 15:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/specific-characters-from-a-string/m-p/443334#M282843</guid>
      <dc:creator>serrld113</dc:creator>
      <dc:date>2018-03-07T15:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: specific characters from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/specific-characters-from-a-string/m-p/443339#M282844</link>
      <description>&lt;P&gt;something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string $;
datalines;
5021060
A310603
D1A5421
5022000
5001050
5002000
5010020
5010045
5010045
50A5421
5012060
5013100
501310D
;

data want;
set have;
if anyalpha(substr(string,1,3)) gt 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 15:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/specific-characters-from-a-string/m-p/443339#M282844</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-03-07T15:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: specific characters from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/specific-characters-from-a-string/m-p/443346#M282845</link>
      <description>&lt;P&gt;Post test data in the form of a datastep!&lt;/P&gt;
&lt;P&gt;Something like (and not tested as not typing all that in):&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  if lengthn(compress(substr(yourvar,1,3),"","ka")) &amp;gt; 0 then output;
run;&lt;/PRE&gt;
&lt;P&gt;So take the first 3 chars, compress down to only a-z and if length &amp;gt; 0 at least one is present&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 15:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/specific-characters-from-a-string/m-p/443346#M282845</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-07T15:22:39Z</dc:date>
    </item>
  </channel>
</rss>

