<?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 to extract a alphanumeric string or check if it exists before a special character in a strin in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-alphanumeric-string-or-check-if-it-exists/m-p/894962#M353532</link>
    <description>&lt;P&gt;Here is one way to accomplish this, you can use PRXPARSE to create the pattern and then PRXMATCH to match the pattern, for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data one; &lt;BR /&gt;input val $27.; &lt;BR /&gt;cards; &lt;BR /&gt;JT 5366792.2 849M2 PP??? &lt;BR /&gt;JT 1.501 HA &lt;BR /&gt;JT 5394885.2 852M2 GV &lt;BR /&gt;JT B749106.3 685M2 RV 09/99 &lt;BR /&gt;; &lt;BR /&gt;&lt;BR /&gt;data new; &lt;BR /&gt;set one; &lt;BR /&gt;if _n_=1 then do; &lt;BR /&gt;pattern1=prxparse('/\d\d\d\d\d\d\d.\d/'); &lt;BR /&gt;pattern2=prxparse('/\w\d\d\d\d\d\d.\d/'); &lt;BR /&gt;end; &lt;BR /&gt;retain pattern1 pattern2; &lt;BR /&gt;pos1=prxmatch(pattern1,val); &lt;BR /&gt;pos2=prxmatch(pattern2,val); &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;proc print; &lt;BR /&gt;run; &lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2023 18:38:41 GMT</pubDate>
    <dc:creator>russt_sas</dc:creator>
    <dc:date>2023-09-19T18:38:41Z</dc:date>
    <item>
      <title>How to extract a alphanumeric string or check if it exists before a special character in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-alphanumeric-string-or-check-if-it-exists/m-p/894880#M353489</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data set has a column that can have any alphanumeric characters or special symbols, but I want to flag only those records that have a certain type of alphanumeric string in them. For eg, values in my string could be :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JT 5366792.2 849M2 PP???&amp;nbsp; &amp;nbsp;(to be picked up)&lt;/P&gt;&lt;P&gt;JT 1.501 HA&amp;nbsp; &amp;nbsp;(don't pick up coz there is no 7-8 digit string before the dot)&lt;/P&gt;&lt;P&gt;JT 5394885.2 852M2 GV (pick up)&lt;/P&gt;&lt;P&gt;JT B749106.3 685M2 RV 09/99&amp;nbsp; (pick up)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the records that I want to pick are the ones that have the registration numbers in format : B749106.3 or&amp;nbsp;5366792.2. Usually there will be a . present with only one digit after it but the string before . could contain either characters or numbers (length of the total string could be 7-8 characters before the dot(.). Is there any way I can code around this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't need to output the exact registration number, but only need to highlight the row that contains that registration number in that format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with SAS code is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 04:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-alphanumeric-string-or-check-if-it-exists/m-p/894880#M353489</guid>
      <dc:creator>waliaa</dc:creator>
      <dc:date>2023-09-19T04:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a alphanumeric string or check if it exists before a special character in a strin</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-alphanumeric-string-or-check-if-it-exists/m-p/894962#M353532</link>
      <description>&lt;P&gt;Here is one way to accomplish this, you can use PRXPARSE to create the pattern and then PRXMATCH to match the pattern, for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data one; &lt;BR /&gt;input val $27.; &lt;BR /&gt;cards; &lt;BR /&gt;JT 5366792.2 849M2 PP??? &lt;BR /&gt;JT 1.501 HA &lt;BR /&gt;JT 5394885.2 852M2 GV &lt;BR /&gt;JT B749106.3 685M2 RV 09/99 &lt;BR /&gt;; &lt;BR /&gt;&lt;BR /&gt;data new; &lt;BR /&gt;set one; &lt;BR /&gt;if _n_=1 then do; &lt;BR /&gt;pattern1=prxparse('/\d\d\d\d\d\d\d.\d/'); &lt;BR /&gt;pattern2=prxparse('/\w\d\d\d\d\d\d.\d/'); &lt;BR /&gt;end; &lt;BR /&gt;retain pattern1 pattern2; &lt;BR /&gt;pos1=prxmatch(pattern1,val); &lt;BR /&gt;pos2=prxmatch(pattern2,val); &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;proc print; &lt;BR /&gt;run; &lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 18:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-alphanumeric-string-or-check-if-it-exists/m-p/894962#M353532</guid>
      <dc:creator>russt_sas</dc:creator>
      <dc:date>2023-09-19T18:38:41Z</dc:date>
    </item>
  </channel>
</rss>

