<?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: scrub character field for all numeric value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573847#M162065</link>
    <description>&lt;P&gt;Paige,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This name field has business names.. I don't want to flag a name like A1 Cleaning as junk, that is why I need to evaluate the entire name field for all numeric values.&amp;nbsp; Not some character and some numeric.&amp;nbsp; does that make sense?&amp;nbsp; I am trying to keep this data to a workable level.&amp;nbsp; flagging names like that as junk would greatly increase the number of records I pull into the report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Elliott&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2019 14:31:06 GMT</pubDate>
    <dc:creator>Elliott</dc:creator>
    <dc:date>2019-07-16T14:31:06Z</dc:date>
    <item>
      <title>scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573673#M162002</link>
      <description>&lt;P&gt;I have to scrub a name field for anything considered junk and I am using index for character junk data but I also need to look for any all numeric values, like if someone put a phone number in the name field.&amp;nbsp; how do I evaluate for all numeric values in a character field?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Elliott&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 19:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573673#M162002</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2019-07-15T19:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573676#M162004</link>
      <description>anynum, anyalpha functions or notalpha, etc type of functions. And there's always regex as well.</description>
      <pubDate>Mon, 15 Jul 2019 19:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573676#M162004</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-15T19:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573721#M162023</link>
      <description>&lt;P&gt;Also look at the compress function, especially with the 'd' and 'dk' modifiers.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 02:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573721#M162023</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-07-16T02:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573819#M162061</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have researched all these options including the compress with d or dk options.... I need to evaluate the entire name field for all numeric values.&amp;nbsp; Not the first numeric within character data.&amp;nbsp; an example would be if someone put a phone number in the name field by mistake, I need to flag that with a 1.&amp;nbsp; Then when I just pull out all the values that were considered junk (flag=1) any all numeric value will be included.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;are there any other options?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Elliott&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 12:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573819#M162061</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2019-07-16T12:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573823#M162062</link>
      <description>&lt;P&gt;The suggestion by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;to use COMPRESS is exactly what you want. Although you say&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I need to evaluate the entire name field for all numeric values.&amp;nbsp; Not the first numeric within character data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;so its not clear why, if you find even one such number in the text string, you need to look for additional numbers, you can set your flag once you find the first number. In which case, ANYNUM will do the job as well.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 13:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573823#M162062</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-16T13:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573847#M162065</link>
      <description>&lt;P&gt;Paige,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This name field has business names.. I don't want to flag a name like A1 Cleaning as junk, that is why I need to evaluate the entire name field for all numeric values.&amp;nbsp; Not some character and some numeric.&amp;nbsp; does that make sense?&amp;nbsp; I am trying to keep this data to a workable level.&amp;nbsp; flagging names like that as junk would greatly increase the number of records I pull into the report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Elliott&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 14:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573847#M162065</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2019-07-16T14:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573853#M162071</link>
      <description>&lt;P&gt;Yes, it makes sense, but then you need to develop (at least in your mind and then explain it to us) what the rules are that would allow you to determine which records get flagged and which don't. I understand now why A1 Cleaning should not be flagged; here in Buffalo, NY (area code 716) there are a few businesses with names like "716 Cigars", I suppose those shouldn't get flagged either. So what are the rules that determines whether a business name gets flagged or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Back to SAS, the ANYDIGIT function can be used iteratively within a DO loop in a DATA step so that you can find the locations of all digits in a character string.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 14:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573853#M162071</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-16T14:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573865#M162080</link>
      <description>&lt;P&gt;Paige,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have reached out to the requester to explain the issue for all numeric values.&amp;nbsp; So now she wants to look for any business name where the first position is a numeric.&amp;nbsp; In this case "716 Cigars" would be pulled in, but I think that may be the best we can do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;currently in my code I have a long list of&amp;nbsp; if index(lowercase(name),"???") &amp;gt; 0 or .....index(lowercase(name),"???") &amp;gt; 0.. then flag=1; logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what would the compress logic look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Elliott&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 14:52:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573865#M162080</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2019-07-16T14:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573870#M162083</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17300"&gt;@Elliott&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Paige,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what would the compress logic look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;With all due respect, I choose not to answer that until the logic for determining which records are flagged is clear. I suspect that ANYDIGIT will work better than COMPRESS, but all answers are being withheld until I know the logic. (By the way, in the past, many times I have given an answer without clear logic being provided by the user, and the next message from the user is a very clear statement that it won't work in this case or some other case ...)&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 14:55:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/573870#M162083</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-16T14:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574010#M162107</link>
      <description>&lt;P&gt;If looking for a starting digit:&lt;/P&gt;
&lt;PRE&gt;data example;
   infile datalines truncover;
   input string $10.;
   y= anydigit(string);
datalines;
abc
abc123
123abc
...abc
___345
;
run;&lt;/PRE&gt;
&lt;P&gt;Y = 1 is starting digit. If you values might have leading spaces then&lt;/P&gt;
&lt;P&gt;y= anydigit( strip(string));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 21:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574010#M162107</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-16T21:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574020#M162113</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;&amp;nbsp;I don't want to flag a name like A1 Cleaning as junk, that is why I need to evaluate the entire name field for all numeric values.&amp;nbsp; Not some character and some numeric.&amp;nbsp; does that make sense?&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;No it doesn't&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;what would the compress logic look like?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;repeatedly told you, we still don't have a clear view of your needs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Provide examples of input data and the desired outcome, with explanation about how the outcome was reached.&lt;/P&gt;
&lt;P&gt;Just because you can't do it with your current code doesn't mean there isn't a way.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 21:50:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574020#M162113</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-07-16T21:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574024#M162115</link>
      <description>&lt;P&gt;ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 21:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574024#M162115</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2019-07-16T21:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: scrub character field for all numeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574025#M162116</link>
      <description>&lt;P&gt;I used anydigit to get what I needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you Reeza&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 21:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/scrub-character-field-for-all-numeric-value/m-p/574025#M162116</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2019-07-16T21:57:15Z</dc:date>
    </item>
  </channel>
</rss>

