<?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: How can I use like '  ' to choose sth start with letter but followed only numeric numbers in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325441#M62242</link>
    <description>thank you</description>
    <pubDate>Tue, 17 Jan 2017 19:48:17 GMT</pubDate>
    <dc:creator>septemberbulb</dc:creator>
    <dc:date>2017-01-17T19:48:17Z</dc:date>
    <item>
      <title>How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325325#M62221</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a variable called &lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;Marketing_Source_Code, &lt;/FONT&gt;&lt;/SPAN&gt;I want to exclude the code starting with a “P” followed by 3 digits. for example 'P121'.&lt;/P&gt;&lt;P&gt;I've used where &lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;Marketing_Source_Code like 'P___', but it will also delete the ones start with "P' followered by characters, for example 'PERN'.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;How can I only exclude the code starting with a “P” followed by 3 digits.&amp;nbsp; I may need this in urgent but dont know how to search the result.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;Thanks a lot. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 16:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325325#M62221</guid>
      <dc:creator>septemberbulb</dc:creator>
      <dc:date>2017-01-17T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325338#M62222</link>
      <description>&lt;P&gt;You can do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if length(strip(translate(var,' ','0123456789')))=1 then put 'OK'; &amp;nbsp;else put 'NOT-OK';&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 16:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325338#M62222</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-17T16:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325342#M62223</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ANYDIGIT might help in that case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data b ;&lt;BR /&gt; set a ;&lt;BR /&gt; where not(a like "P%" and anydigit(a) in (2,3,4)) ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---Update---&lt;/P&gt;
&lt;P&gt;Well, it is more tricky than I thought...&lt;/P&gt;
&lt;P&gt;This one should work better:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data b ;&lt;BR /&gt; set a ;&lt;BR /&gt; where not(a like "P%" and anyalpha(substr(a,2,3))=0) ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicolas.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 17:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325342#M62223</guid>
      <dc:creator>NicolasRobert</dc:creator>
      <dc:date>2017-01-17T17:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325347#M62225</link>
      <description>&lt;P&gt;Some relevant questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Is your variable always 4 characters long?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. If it is only 3 characters long in some cases, how should P12 be handled?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 17:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325347#M62225</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-17T17:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325408#M62231</link>
      <description>&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;sql&lt;/FONT&gt;&lt;/STRONG&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;delete&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; plc_cust_income&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (MKT_SOURCE_CODE=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RCS1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; OR MKT_SOURCE_CODE=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'BFCE'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; OR MKT_SOURCE_CODE=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'EXEM'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; OR (MKT_SOURCE_CODE like &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"P%"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; and anyalpha(substr(MKT_SOURCE_CODE,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;))=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)) &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&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;Is that right?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;thanks&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 18:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325408#M62231</guid>
      <dc:creator>septemberbulb</dc:creator>
      <dc:date>2017-01-17T18:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325411#M62233</link>
      <description>yes, it is 4 characters long always</description>
      <pubDate>Tue, 17 Jan 2017 18:49:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325411#M62233</guid>
      <dc:creator>septemberbulb</dc:creator>
      <dc:date>2017-01-17T18:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325422#M62237</link>
      <description>&lt;P&gt;OK.&amp;nbsp; It's possible that some of the earlier solutions posted by others are working.&amp;nbsp; Here's a DATA step statement that I know works when you always have four characters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if Marketing_Source_Code =&lt;STRONG&gt;:&lt;/STRONG&gt; 'P' and input(substr(Marketing_Source_Code, 2), ??3.) &amp;gt;&amp;nbsp;. then delete;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 19:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325422#M62237</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-17T19:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325428#M62239</link>
      <description>WORKS, THANK YOU</description>
      <pubDate>Tue, 17 Jan 2017 19:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325428#M62239</guid>
      <dc:creator>septemberbulb</dc:creator>
      <dc:date>2017-01-17T19:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use like '  ' to choose sth start with letter but followed only numeric numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325441#M62242</link>
      <description>thank you</description>
      <pubDate>Tue, 17 Jan 2017 19:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-like-to-choose-sth-start-with-letter-but-followed/m-p/325441#M62242</guid>
      <dc:creator>septemberbulb</dc:creator>
      <dc:date>2017-01-17T19:48:17Z</dc:date>
    </item>
  </channel>
</rss>

