<?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: Phone Number Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68393#M14832</link>
    <description>Phone1=input(scan(Phone_Number,1),best.);&lt;BR /&gt;
	Phone2=input(scan(Phone_Number,2),best.);&lt;BR /&gt;
	Phone3=input(scan(Phone_Number,3),best.);&lt;BR /&gt;
	PhoneCorrect=catx('-',put(Phone1,z3.),put(Phone2,z3.),put(Phone3,z4.));</description>
    <pubDate>Thu, 03 Feb 2011 18:18:06 GMT</pubDate>
    <dc:creator>NickR</dc:creator>
    <dc:date>2011-02-03T18:18:06Z</dc:date>
    <item>
      <title>Phone Number Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68390#M14829</link>
      <description>I have phone number data in which the three “parts” of the phone number were originally stored as separate numeric variables so that any leading zeroes were dropped  (e.g., “014” became 14 and “004” became 4.  So a phone number of 004-017-0123 is now shown as 4-17-123.)&lt;BR /&gt;
&lt;BR /&gt;
How can I re-seperate the numbers and re-add the dropped zeros?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Thu, 03 Feb 2011 06:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68390#M14829</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-03T06:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68391#M14830</link>
      <description>In a DATA step, use the SCAN function to split the data-string into three, and also use the PUT(&lt;VARNAME&gt;,Z3.) for example.  And use CATX to rebuild the number from the components.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/VARNAME&gt;</description>
      <pubDate>Thu, 03 Feb 2011 07:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68391#M14830</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-02-03T07:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68392#M14831</link>
      <description>Thanks Scott, almost there.  When I use CATX to reform the phone numbers after splitting and adding the zeros, CATX drops off the zeros I added.  Any ideas?  My current code is below.  Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Phone_Number=Translate(Phone_Number,'---','._/');&lt;BR /&gt;
&lt;BR /&gt;
format Phone1 Phone2 z3. Phone3 z4.;&lt;BR /&gt;
Phone1=scan(Phone_Number,1);&lt;BR /&gt;
Phone2=scan(Phone_Number,2);&lt;BR /&gt;
Phone3=scan(Phone_Number,3);&lt;BR /&gt;
&lt;BR /&gt;
PhoneCorrect=catx('-',Phone1,Phone2,Phone3);</description>
      <pubDate>Thu, 03 Feb 2011 18:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68392#M14831</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-03T18:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68393#M14832</link>
      <description>Phone1=input(scan(Phone_Number,1),best.);&lt;BR /&gt;
	Phone2=input(scan(Phone_Number,2),best.);&lt;BR /&gt;
	Phone3=input(scan(Phone_Number,3),best.);&lt;BR /&gt;
	PhoneCorrect=catx('-',put(Phone1,z3.),put(Phone2,z3.),put(Phone3,z4.));</description>
      <pubDate>Thu, 03 Feb 2011 18:18:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68393#M14832</guid>
      <dc:creator>NickR</dc:creator>
      <dc:date>2011-02-03T18:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68394#M14833</link>
      <description>change the parameters of catx() so they are strings not numerics - you were getting automatic numeric-to-character conversion&lt;BR /&gt;
 &lt;BR /&gt;
PhoneCorrect=catx('-', put(Phone1,z3.), put(Phone2,z3.), put(Phone3,z4.));</description>
      <pubDate>Thu, 03 Feb 2011 18:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68394#M14833</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-02-03T18:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Phone Number Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68395#M14834</link>
      <description>Thanks everyone.  Things are looking great now.</description>
      <pubDate>Thu, 03 Feb 2011 21:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Phone-Number-Help/m-p/68395#M14834</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-03T21:05:37Z</dc:date>
    </item>
  </channel>
</rss>

