<?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: Removing Special Characters from SAS Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228527#M41285</link>
    <description>&lt;P&gt;I should have been clear with what I wanted !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to check special characters, but skip for date when the date format has colon in it, and skip currency when it has a decimal in it.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Oct 2015 20:54:34 GMT</pubDate>
    <dc:creator>zoomzoom</dc:creator>
    <dc:date>2015-10-05T20:54:34Z</dc:date>
    <item>
      <title>Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228496#M41278</link>
      <description>&lt;P&gt;Hello Members,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a list of variables from different tables and I am trying to filter results by finding special characters using Anypunct function. While it is working mostly, I have encountered few scenarios where the logic fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS brings in date from Oracle in this format DDMMMYYY:00:00:00&lt;/P&gt;
&lt;P&gt;Anypunct considers colon ( : ) as a special character, flags the date field.&lt;/P&gt;
&lt;P&gt;Note: I cannot treat date separately, as the variables come in one by one in a loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly, for currency field, i.e. where there is an amount after decimal, ($72.50 or 52.33) the function considers that decimal as a special character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would be an efficient way to counter this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2015 19:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228496#M41278</guid>
      <dc:creator>zoomzoom</dc:creator>
      <dc:date>2015-10-05T19:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228498#M41279</link>
      <description>&lt;P&gt;What do you expect for output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2015 19:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228498#M41279</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-05T19:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228500#M41280</link>
      <description>Look at the unformatted values, strip the formats using either a put or format statement.</description>
      <pubDate>Mon, 05 Oct 2015 19:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228500#M41280</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-10-05T19:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228527#M41285</link>
      <description>&lt;P&gt;I should have been clear with what I wanted !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to check special characters, but skip for date when the date format has colon in it, and skip currency when it has a decimal in it.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2015 20:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228527#M41285</guid>
      <dc:creator>zoomzoom</dc:creator>
      <dc:date>2015-10-05T20:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228542#M41286</link>
      <description>&lt;P&gt;Is there a reason you are looking for those characters ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason i ask is you do not need to do special coding to remove those special characters.&lt;/P&gt;
&lt;P&gt;for example if you use sas informat &amp;nbsp;Dollar15.2 &amp;nbsp;format to&amp;nbsp;read the amount as a number&amp;nbsp;&lt;/P&gt;
&lt;P&gt;similarly you &amp;nbsp;can use sas informat anytm to convert Oracle timestamp to SAS timestamp&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2015 22:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228542#M41286</guid>
      <dc:creator>Smijoss</dc:creator>
      <dc:date>2015-10-05T22:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228545#M41287</link>
      <description>&lt;P&gt;Questions about what you have vs. what you need ... let's limit it to just the dates for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you really need to "filter" dates, or do you just need to find the proper date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to "filter", what does that mean?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know which variables are supposed to represent dates?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you really have 3-digit months and 3-digit years?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the time portion always 00:00:00?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Related to the last 2 questions, perhaps you could give an example of what is actually in the data, and what it represents.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer is probably simple, but framing the problem might be more difficult.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2015 23:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228545#M41287</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-10-05T23:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228551#M41288</link>
      <description>&lt;P&gt;I would expect your date and currency column to be of SAS data type numeric. If so: There is no need to check for special characters in numeric variables and it certainly doesn't make sense to check the formatted values. Limit your checks to character values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anypunct() alone then still doesn't cut it for the character variables&amp;nbsp;then you might consider using Regular Expressions to exclude certain patterns from checking.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2015 23:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228551#M41288</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-10-05T23:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228616#M41310</link>
      <description>&lt;P&gt;you should use datepart()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date = datepart(DDMMMYYY:00:00:00)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are not special characters, sas views this as a time and is formated to display date and time.&amp;nbsp; Datepart() will drop the time.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 12:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228616#M41310</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-06T12:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from SAS Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228724#M41337</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The code snippet you've posted is not valid SAS syntax.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;date = datepart(DDMMMYYY:00:00:00)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not sure what you're proposing here and why.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 20:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Special-Characters-from-SAS-Date/m-p/228724#M41337</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-10-06T20:56:56Z</dc:date>
    </item>
  </channel>
</rss>

