<?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: Changing phone number to a 7 digit number in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691101#M37273</link>
    <description>&lt;P&gt;COMPRESS removes blanks. Here is one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  phone = '+61(2)1234567';
  phone = transtrn(phone, '+61(2)', '');
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Oct 2020 23:09:04 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-10-12T23:09:04Z</dc:date>
    <item>
      <title>Changing phone number to a 7 digit number</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691097#M37272</link>
      <description>&lt;P&gt;Hi, I'm working on a problem that wants me to create an advanced filter for a 'Phone_number" variable, that removes the extension at the beginning of the phone numbers, making them 7 digit numbers. The extensions are&amp;nbsp;+61(2)',&amp;nbsp;'+61(3)', and '+61(5)'&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I've been trying :&lt;STRONG&gt;&amp;nbsp;COMPRESS(t1.Phone_Number, "+61(2)", "+61(3)", "+61(5)")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please tell me what I'm doing wrong and provide the correct FUNCTION to use in this scenario.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 00:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691097#M37272</guid>
      <dc:creator>BrockJarvie</dc:creator>
      <dc:date>2020-10-13T00:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Changing phone number to a 7 digit number</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691101#M37273</link>
      <description>&lt;P&gt;COMPRESS removes blanks. Here is one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  phone = '+61(2)1234567';
  phone = transtrn(phone, '+61(2)', '');
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Oct 2020 23:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691101#M37273</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-10-12T23:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Changing phone number to a 7 digit number</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691105#M37274</link>
      <description>&lt;P&gt;And this will work as an advanced filter to a pre-existing column in the Querybuilder?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 00:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691105#M37274</guid>
      <dc:creator>BrockJarvie</dc:creator>
      <dc:date>2020-10-13T00:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing phone number to a 7 digit number</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691106#M37275</link>
      <description>&lt;P&gt;A filter selects rows it doesn't transform values so no.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 00:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691106#M37275</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-10-13T00:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Changing phone number to a 7 digit number</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691112#M37276</link>
      <description>&lt;P&gt;So are you suggesting I make a new computed column?&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would you attempt it?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 00:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691112#M37276</guid>
      <dc:creator>BrockJarvie</dc:creator>
      <dc:date>2020-10-13T00:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Changing phone number to a 7 digit number</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691118#M37278</link>
      <description>&lt;P&gt;You could try pasting the relevant statement into the QueryBuilder as a new computed column - I guess it is SQL:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;transtrn(phone, '+61(2)', '')&amp;nbsp;as&amp;nbsp;phone_new&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2020 02:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691118#M37278</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-10-13T02:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Changing phone number to a 7 digit number</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691313#M37294</link>
      <description>&lt;P&gt;You should be able to do it in a generalized way using regular expressions. Using this code to create some data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
	length Phone_Number $20;
	input Phone_Number;
	cards;
+61(2)1234567
+61(3)9876543
+61(5)2223333
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;create a new query on the data. Set up a new Advanced Expression, and in the "Enter an expression:" box, copy and paste:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;prxchange("s/(\+[[:digit:]]+\([[:digit:]]\))([[:digit:]]+)/$2/", -1, Phone_Number)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 15:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-phone-number-to-a-7-digit-number/m-p/691313#M37294</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2020-10-13T15:36:29Z</dc:date>
    </item>
  </channel>
</rss>

