<?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: Flag phone numer formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610225#M177688</link>
    <description>&lt;P&gt;Thanks for the post.&amp;nbsp; If I see a number like 1111111111, 2222222222 etc, these are not valid phone number because you cannot call those numbers.&amp;nbsp; Your code does satisfy the 9 digit format requirement.&amp;nbsp; Is there a way to modify the code to address the above issue??&lt;/P&gt;</description>
    <pubDate>Sat, 07 Dec 2019 20:57:10 GMT</pubDate>
    <dc:creator>Q1983</dc:creator>
    <dc:date>2019-12-07T20:57:10Z</dc:date>
    <item>
      <title>Flag phone numer formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610217#M177686</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Phone &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$15.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0000000000&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;1111111111&lt;/P&gt;
&lt;P&gt;2222222222&lt;/P&gt;
&lt;P&gt;8391134456&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;I have a dataset that presents phone numbers as a character variable which is common.&amp;nbsp; If the phone number is a blank, a 0 or some other incomplete phone number I want to flag it.&amp;nbsp; So in the above example the last transaction is an actual phone number that can be called.&amp;nbsp; The others are not.&amp;nbsp; In this example I using just a few examples however the phone field could show any combination of incomplete phone numbers.&amp;nbsp; Should this be done through something like proc format or is there another way&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 18:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610217#M177686</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-12-07T18:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Flag phone numer formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610222#M177687</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the PRXMATCH function to do this job.&lt;/P&gt;
&lt;P&gt;This function checks whether a variable matches a specified pattern.&lt;/P&gt;
&lt;P&gt;According to your description, I assume that the condition to be considered as a valid phone number is to have 10 digits.&lt;/P&gt;
&lt;P&gt;If this is right, you can specify the following pattern (= look for 10 digits). Otherwise, you need to specify the rules (e.g. to have the 3 first digits in let's say 2-8, ...). For further information about this function:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0bj9p4401w3n9n1gmv6tf**bleep**9m.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0bj9p4401w3n9n1gmv6tf**bleep**9m.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	if prxmatch('/\d{10}/', Phone) then flag = 1;
	else flag = 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 19:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610222#M177687</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-07T19:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Flag phone numer formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610225#M177688</link>
      <description>&lt;P&gt;Thanks for the post.&amp;nbsp; If I see a number like 1111111111, 2222222222 etc, these are not valid phone number because you cannot call those numbers.&amp;nbsp; Your code does satisfy the 9 digit format requirement.&amp;nbsp; Is there a way to modify the code to address the above issue??&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 20:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610225#M177688</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-12-07T20:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Flag phone numer formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610229#M177689</link>
      <description>&lt;P&gt;cancel the last question, I will just redefine those affected phone numbers&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 22:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flag-phone-numer-formats/m-p/610229#M177689</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-12-07T22:11:25Z</dc:date>
    </item>
  </channel>
</rss>

