<?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: To extract Alpha/numerical  from a sentence in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143970#M38301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still the PRX functions will offer a succinct solution, if you want to get rid of the blanks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; HAVE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;INPUT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; VAR $ &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;40.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUM=COMPRESS(VAR,,'KD');*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEWVAR=PRXCHANGE(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'s/.+([A-Z]{2}) *(\d+).*/$1$2/o'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,-&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,VAR);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;CARDS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah blah TG0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah DF0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah blah FG0001 blah blah&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah GH 0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;You will have to show some sample data that is not working. People here can only provide solutions based on your sample data, we don't know your data, you do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jun 2014 12:54:41 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2014-06-18T12:54:41Z</dc:date>
    <item>
      <title>To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143963#M38294</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 need to extract data that will be 5 characters example TG0001 which is machine #&amp;nbsp; . I'm currently dealing with over 5k machines which have a unique number . I tried compress an it just provided me the # not the letters.&lt;/P&gt;&lt;P&gt;the column something like&lt;/P&gt;&lt;P&gt;column &lt;/P&gt;&lt;P&gt;blah blah TG0001&lt;/P&gt;&lt;P&gt;blah DF0001&lt;/P&gt;&lt;P&gt;blah blah FG0001 blah blah&lt;/P&gt;&lt;P&gt;blah GH 0001&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In some cases there might be a space between number an alpha . Not pretty the data is manually input &lt;/P&gt;&lt;P&gt;thank you for your &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 00:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143963#M38294</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2014-06-17T00:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143964#M38295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hard to envision how to possibly tackle this without more concrete examples of text lines you are dealing with. Any chance you can provide a sample, with actual text values (of course, changing anything that might be security sensitive)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 01:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143964#M38295</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-06-17T01:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143965#M38296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want keep any non-digits at all, and there is no other digits except this one location, then COMPRESS() will be my first option:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;DATA&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; HAVE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;INPUT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; VAR $ &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;40.&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUM=COMPRESS(VAR,,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'KD'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;CARDS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah blah TG0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah DF0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah blah FG0001 blah blah&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah GH 0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 02:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143965#M38296</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-17T02:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143966#M38297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on the specified pattern this may produce the desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input col $ 30.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;blah blah TG2001&lt;/P&gt;&lt;P&gt;blah DF0001&lt;/P&gt;&lt;P&gt;blah blah FG0001 blah blah&lt;/P&gt;&lt;P&gt;blah GH 0004&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;length machine_number $8.;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;machine_number=catt(substr(col,find(col,compress(col,,'kd'))-3,3),compress(col,,'kd'));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 02:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143966#M38297</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-17T02:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143967#M38298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi BETO,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is difficult to produce a solution that works without knowing the exact structure of the data in which it is contained.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an approach using PERL regular expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA HAVE;&lt;/P&gt;&lt;P&gt;INPUT COL $ 30.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF _N_ = 1 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETAIN PATTERN1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATTERN1 = PRXPARSE("/(\w{2}\d{4})|(\w{2}\s\d{4})/");&lt;/P&gt;&lt;P&gt;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CALL PRXSUBSTR(PATTERN1,COL,START,LENGTH);&lt;/P&gt;&lt;P&gt;&amp;nbsp; COL1 = COMPRESS(SUBSTR(COL,START,LENGTH));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;BLAH BLAH TG2001&lt;/P&gt;&lt;P&gt;BLAH DF0001&lt;/P&gt;&lt;P&gt;BLAH BLAH FG0001 BLAH BLAH&lt;/P&gt;&lt;P&gt;BLAH GH 0004&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ("/(\w{2}\d{4})|(\w{2}\s\d{4})/") portion of the code defines the pattern you wish to match.&amp;nbsp; In this case 2 word elements followed by 4 digits OR&amp;nbsp; 2 word elements followed by a space and 4 digits. CALL PRXSUBSTR finds a string that matches the conditions in PATTERN1 and produces 2 variables which we have named START and LENGTH.&amp;nbsp; We then use the values in these 2 variables to extract a string from the original COL variable using the SUBSTR function;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 05:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143967#M38298</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-06-17T05:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143968#M38299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like Perl Regular Expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;DATA HAVE;
INPUT COL $ 30.;
&amp;nbsp; IF _N_ = 1 THEN DO;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETAIN re;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; re = PRXPARSE("/([A-Z]{2}\s*\d{4})/");
&amp;nbsp; END;
 if prxmatch(re,col) then&amp;nbsp; COL1 =prxposn(re,1,col);
DATALINES;
BLAH BLAH TG2001
BLAH DF0001
BLAH BLAH FG0001 BLAH BLAH
BLAH GH 0004
;
RUN;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 12:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143968#M38299</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-06-17T12:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143969#M38300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI stat@sas&amp;nbsp; your snippet of code work pretty good gave me about 80 % which is acceptable ..the issue that I have run across is that the output is coming in with spaces . I did a compress but it removed the 2 character Id and just gave me the numical. Any thoughts how to remove blanks an keep the output intact? Thanks again &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 05:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143969#M38300</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2014-06-18T05:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143970#M38301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still the PRX functions will offer a succinct solution, if you want to get rid of the blanks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; HAVE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;INPUT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; VAR $ &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;40.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUM=COMPRESS(VAR,,'KD');*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEWVAR=PRXCHANGE(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'s/.+([A-Z]{2}) *(\d+).*/$1$2/o'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,-&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,VAR);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;CARDS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah blah TG0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah DF0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah blah FG0001 blah blah&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;blah GH 0001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;You will have to show some sample data that is not working. People here can only provide solutions based on your sample data, we don't know your data, you do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 12:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143970#M38301</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-18T12:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143971#M38302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is based on what you provided. If you can provide some extract from 20% where this is not working will help to understand your problem in a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 13:30:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143971#M38302</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-18T13:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143972#M38303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Kuo&lt;/P&gt;&lt;P&gt;i will be refer a table name info where do I make refer to it in that syntax ? The column name is cust name where do I make that refer ..thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 13:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143972#M38303</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2014-06-18T13:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143973#M38304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA want;&lt;/P&gt;&lt;P&gt;set YOURDATA;&lt;/P&gt;&lt;P&gt;&amp;nbsp; NEWVAR=PRXCHANGE('s/.+([A-Z]{2}) *(\d+).*/$1$2/o',-1,VAR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 13:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143973#M38304</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-18T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143974#M38305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;your data is name of table ...where do I make refer to column the name of column is "CUST NAME"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 14:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143974#M38305</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2014-06-18T14:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143975#M38306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, my bad. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEWVAR=PRXCHANGE('s/.+([A-Z]{2}) *(\d+).*/$1$2/o',-1,CUST_NAME); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;double check the variable name (not the label). If it does have blanks embedded like you said, then you will need literal reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; NEWVAR=PRXCHANGE('s/.+([A-Z]{2}) *(\d+).*/$1$2/o',-1,'CUST NAME'n);&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 14:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143975#M38306</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-18T14:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143976#M38307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HEre is the error I'm getting &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Info;&lt;/P&gt;&lt;P&gt;822&amp;nbsp; set info&lt;/P&gt;&lt;P&gt;823&amp;nbsp; /*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUM=COMPRESS(VAR,,'KD');*/&lt;/P&gt;&lt;P&gt;824&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEWVAR=PRXCHANGE('s/.+([A-Z]{2}) *(\d+).*/$1$2/o',-1,'CUST_NAME'n);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 76&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END, INDSNAME, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;825&lt;/P&gt;&lt;P&gt;826&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;827&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 16:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143976#M38307</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2014-06-18T16:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143977#M38308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind I fig I was missing a ; it works thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 16:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143977#M38308</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2014-06-18T16:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: To extract Alpha/numerical  from a sentence</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143978#M38309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are missing a ";' after set info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 16:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-extract-Alpha-numerical-from-a-sentence/m-p/143978#M38309</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-18T16:37:22Z</dc:date>
    </item>
  </channel>
</rss>

