<?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 ticket number after # an only   8numbers ? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235354#M55061</link>
    <description>&lt;P&gt;If you can rely on the first # being before the ticket number, it's easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;length ticket $ 8;&lt;/P&gt;
&lt;P&gt;ticket = scan(text, 2, '#');&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you actually need 9 digits instead of 8 (you have 9 in your example), just change the length to $ 9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Nov 2015 19:05:17 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2015-11-18T19:05:17Z</dc:date>
    <item>
      <title>How to extract ticket number after # an only   8numbers ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235350#M55058</link>
      <description>&lt;P&gt;Hi I have a comment box that looks like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Arrive 11/16/15 &amp;nbsp; ticket #012345678 prod Id 45678&lt;/P&gt;
&lt;P&gt;I need to just get the ticket# &amp;nbsp;which is the 8 digits ...I need output to be 012345678.. I use compress an it combine it together. .. I read up on prxchange &amp;nbsp;to extract but it's not working &amp;nbsp;thanks for your assistance&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data table1;&lt;/P&gt;
&lt;P&gt;Set table1;&lt;/P&gt;
&lt;P&gt;Ticket =prxchange ("S/[^0-9]//",-1,text);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 19:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235350#M55058</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-11-18T19:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ticket number after # an only   8numbers ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235354#M55061</link>
      <description>&lt;P&gt;If you can rely on the first # being before the ticket number, it's easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;length ticket $ 8;&lt;/P&gt;
&lt;P&gt;ticket = scan(text, 2, '#');&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you actually need 9 digits instead of 8 (you have 9 in your example), just change the length to $ 9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 19:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235354#M55061</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-11-18T19:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ticket number after # an only   8numbers ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235371#M55064</link>
      <description>&lt;P&gt;Similar solution but if I understand you correct you want another scan() in there:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;infile cards dsd dlm='*****';&lt;BR /&gt;informat field $100.;&lt;BR /&gt;format field $100.;&lt;BR /&gt;input field$;&lt;BR /&gt;cards;&lt;BR /&gt;Arrive 11/16/15&amp;nbsp;&amp;nbsp; ticket #012345678 prod Id 45678&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;want = scan(scan(field,2,'#'),1);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 19:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235371#M55064</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-11-18T19:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ticket number after # an only   8numbers ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235397#M55070</link>
      <description>&lt;P&gt;Steelers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's the purpose of having the LENGTH statement. &amp;nbsp;There's only room to hold 8 characters in the new variable, so you don't have to worry about getting rid of extra characters with an additional SCAN function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does require that the ticket numbers are 8 characters long, however. &amp;nbsp;(7 would be OK too, if the 8th character is a blank.)&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 23:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235397#M55070</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-11-18T23:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ticket number after # an only   8numbers ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235398#M55071</link>
      <description>Hi Steelers it worked great  but I do have a question the output has a semi colon :it's looks like this :012345678 I need the out put to be 012345678 ... thanks</description>
      <pubDate>Wed, 18 Nov 2015 23:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235398#M55071</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-11-18T23:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ticket number after # an only   8numbers ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235400#M55073</link>
      <description>&lt;P&gt;It is easy to get number with scan here, if you want to use regular expression, try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
string="Arrive 11/16/15   ticket #012345678 prod Id 45678";
number=prxchange('s/.*(?&amp;lt;=#)(\d+).*/$1/',-1,string);
put number;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Nov 2015 00:06:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235400#M55073</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-11-19T00:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ticket number after # an only   8numbers ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235401#M55074</link>
      <description>&lt;P&gt;Is there a colon in the incoming text, after the # ???&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 00:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-extract-ticket-number-after-an-only-8numbers/m-p/235401#M55074</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-11-19T00:06:08Z</dc:date>
    </item>
  </channel>
</rss>

