<?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: ANYALPHA &amp;amp; ANYDIGIT VALIDATION in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338876#M9720</link>
    <description>&lt;P&gt;Thanks a lot Ksharp I didn´t know about this PRXMATCH command it did work great!!&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 16:08:24 GMT</pubDate>
    <dc:creator>BernyOsuna</dc:creator>
    <dc:date>2017-03-07T16:08:24Z</dc:date>
    <item>
      <title>ANYALPHA &amp; ANYDIGIT VALIDATION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338584#M9717</link>
      <description>&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i have a dataset with a variable with ID´s. ID´s should consist of 2 ALPHA positions and 8 DIGITposition. If this requirement is not met i should write it in a separated dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AB12345678&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first filter i wanna say its the length = 10.&lt;/P&gt;&lt;P&gt;Second one is that first 2 positions both should be ALPHA.&lt;/P&gt;&lt;P&gt;Third that every single position from the 3rd to the 10th should be DIGIT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If any of this requirements is not met, immediatly without going any further should be sent to a dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´ve seen the following code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data _null_;    
   string='Next = _n_ + 12E3;';  
   j=0;  
   do until(j=0);  
      j=anyalpha(string,j+1);  
      if j=0 then put +3 "That's all";  
      else do;          
         c=substr(string,j,1);  
         put +3 j= c=;  
      end; 
   end;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But i wonder how could i integrate the ANYDIGIT part and the conditional for every position after has been validated wheater is an ALPHA or a DIGIT.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 21:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338584#M9717</guid>
      <dc:creator>BernyOsuna</dc:creator>
      <dc:date>2017-03-06T21:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: ANYALPHA &amp; ANYDIGIT VALIDATION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338588#M9718</link>
      <description>&lt;P&gt;Substr out the components and check them. Look at NOTALPHA/NOTDIGIT as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LENGTH() = 10&lt;/P&gt;
&lt;P&gt;SUBSTR(string, 1, 2) - NOTALPHA&lt;/P&gt;
&lt;P&gt;SUBSTR(string, 3, &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; - NOTDIGIT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 21:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338588#M9718</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-06T21:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: ANYALPHA &amp; ANYDIGIT VALIDATION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338665#M9719</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x $20.;
cards;
AB12345678
A12345678
;
run;
data right error;
 set have;
 if prxmatch('/^[a-z]{2}\d{8}$/i',strip(x)) then output right;
  else output error;
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 03:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338665#M9719</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-07T03:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: ANYALPHA &amp; ANYDIGIT VALIDATION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338876#M9720</link>
      <description>&lt;P&gt;Thanks a lot Ksharp I didn´t know about this PRXMATCH command it did work great!!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 16:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/ANYALPHA-amp-ANYDIGIT-VALIDATION/m-p/338876#M9720</guid>
      <dc:creator>BernyOsuna</dc:creator>
      <dc:date>2017-03-07T16:08:24Z</dc:date>
    </item>
  </channel>
</rss>

