<?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 Easy One.... Where string starts with [A-Z]..... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84708#M256905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully an easy one for you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In T-SQL i used to write something along the lines of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select *&lt;/P&gt;&lt;P&gt;from Table1&lt;/P&gt;&lt;P&gt;Where field1 like '[A-Z]%'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would select all records from Table1 where field1 started with any character between A and Z. It would not bring back records starting with a number or a non alphanumeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i did&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Where field1 like '[A-Z][0-9]%' it would return al rows starting with one letter and then a number.. like "S2 Antfarm"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do this in SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2013 13:56:45 GMT</pubDate>
    <dc:creator>ChrisElias</dc:creator>
    <dc:date>2013-01-24T13:56:45Z</dc:date>
    <item>
      <title>Easy One.... Where string starts with [A-Z].....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84708#M256905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully an easy one for you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In T-SQL i used to write something along the lines of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select *&lt;/P&gt;&lt;P&gt;from Table1&lt;/P&gt;&lt;P&gt;Where field1 like '[A-Z]%'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would select all records from Table1 where field1 started with any character between A and Z. It would not bring back records starting with a number or a non alphanumeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i did&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Where field1 like '[A-Z][0-9]%' it would return al rows starting with one letter and then a number.. like "S2 Antfarm"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do this in SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 13:56:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84708#M256905</guid>
      <dc:creator>ChrisElias</dc:creator>
      <dc:date>2013-01-24T13:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Easy One.... Where string starts with [A-Z].....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84709#M256906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have function in sas such as anyalnum,anyalpha(),anydigit()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyalnum(), in a string if there is any alpha numeric value it will give the position of that character in numbers, if none is found then it results in 0, similary&lt;/P&gt;&lt;P&gt;anyalpha(), in a string it searches for only character value&lt;/P&gt;&lt;P&gt;anydigit(), in a string it searches for only numeric value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 14:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84709#M256906</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-01-24T14:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Easy One.... Where string starts with [A-Z].....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84710#M256907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I believe PRXMATCH would allow you to "match" any alphanumeric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have(where = (&lt;STRONG&gt; (prxmatch("m/[a-z]|[0-9]/i",your_variable) &amp;gt; 0))&lt;/STRONG&gt; );&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;using sashelp.class if you want to keep the records that contain the letter 'b' or any number in the name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class(where = ( (prxmatch("m/&lt;STRONG&gt;&lt;B&gt;|[0-9]&lt;/B&gt;&lt;/STRONG&gt;&lt;B&gt;/i",name) &amp;gt; 0) ));&lt;/B&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 14:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84710#M256907</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-01-24T14:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Easy One.... Where string starts with [A-Z].....</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84711#M256908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks once again Jagadish for a quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca - you were right on the button with that one!! Excellent and thanks for you help - you're a genius!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 15:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easy-One-Where-string-starts-with-A-Z/m-p/84711#M256908</guid>
      <dc:creator>ChrisElias</dc:creator>
      <dc:date>2013-01-24T15:01:38Z</dc:date>
    </item>
  </channel>
</rss>

