<?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: SAS function to remove records which contains special characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218034#M40175</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a good approach, but it needs a little tweaking on two counts.&amp;nbsp; First, STRIP isn't needed.&amp;nbsp; Leading and trailing blanks don't need to be removed if you only want to detect whether any characters remain.&amp;nbsp; Second, LENGTH has a quirk:&amp;nbsp; it never returns zero.&amp;nbsp; The minimum value returned is 1.&amp;nbsp; The easiest way to overcome this is to switch to LENGTHN:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lengthn(compress(the_string,,'d'))=0 then output;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2015 15:13:52 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2015-05-21T15:13:52Z</dc:date>
    <item>
      <title>SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218029#M40170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I request someone guide me to remove the records which contains special characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Have:&lt;/P&gt;&lt;P&gt;+1234&lt;/P&gt;&lt;P&gt;123 4&lt;/P&gt;&lt;P&gt;12-3&lt;/P&gt;&lt;P&gt;1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want:&lt;/P&gt;&lt;P&gt;1234&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 14:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218029#M40170</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-21T14:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218030#M40171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at using a DATA step to INPUT your data-records, then test using one of the appropriate ANY-prefix SAS functions found in the SAS Language Elements / CALL function documentation.&amp;nbsp; A tip is that you can use _INFILE_ as the argument passed to your function call, although it is unclear if you want to create an output file (non-SAS) or a SAS data library member based on your input -- that would determine whether or not a FILE statement is warranted as opposed to a SAS member on your DATA statement, instead of DATA _NULL_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott Barry&lt;BR /&gt;SBBWorks, Inc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 14:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218030#M40171</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-05-21T14:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218031#M40172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compress.&amp;nbsp; If you want on a single result from them, then sort nodupkey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new_variable=compress(old_variable,,'kd');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 14:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218031#M40172</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-21T14:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218032#M40173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My real data looks like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data Have:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;+1234&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;213 0&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;782-3&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1239&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1239&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;In this case how to dealt with compress function? Any other functions to look for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 15:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218032#M40173</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-21T15:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218033#M40174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if length(strip(compress(the_string,,'d'))) = 0 then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e. if I remove all numbers, and length is zero, there is nothing other than numbers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 15:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218033#M40174</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-21T15:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218034#M40175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a good approach, but it needs a little tweaking on two counts.&amp;nbsp; First, STRIP isn't needed.&amp;nbsp; Leading and trailing blanks don't need to be removed if you only want to detect whether any characters remain.&amp;nbsp; Second, LENGTH has a quirk:&amp;nbsp; it never returns zero.&amp;nbsp; The minimum value returned is 1.&amp;nbsp; The easiest way to overcome this is to switch to LENGTHN:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lengthn(compress(the_string,,'d'))=0 then output;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 15:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218034#M40175</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-05-21T15:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218035#M40176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data Have;&lt;/P&gt;&lt;P&gt;input num $6.;&lt;/P&gt;&lt;P&gt;if prxmatch('/^\d{4}/o',strip(num))^=0 then output;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;+1234&lt;/P&gt;&lt;P&gt;213 0&lt;/P&gt;&lt;P&gt;782-3&lt;/P&gt;&lt;P&gt;1239&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 15:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218035#M40176</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-05-21T15:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218036#M40177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data Have;&lt;/P&gt;&lt;P&gt;input num $20.;&lt;/P&gt;&lt;P&gt;if not prxmatch('/\D/',strip(num)) then output;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;+1234&lt;/P&gt;&lt;P&gt;213 0&lt;/P&gt;&lt;P&gt;782-3&lt;/P&gt;&lt;P&gt;1239&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218036#M40177</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-22T13:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS function to remove records which contains special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218037#M40178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data Have;&lt;/P&gt;&lt;P&gt;input num $20.;&lt;/P&gt;&lt;P&gt;if not notdigit(strip(num)) then output;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;+1234&lt;/P&gt;&lt;P&gt;213 0&lt;/P&gt;&lt;P&gt;782-3&lt;/P&gt;&lt;P&gt;1239&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-function-to-remove-records-which-contains-special-characters/m-p/218037#M40178</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-22T13:50:35Z</dc:date>
    </item>
  </channel>
</rss>

