<?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 How to replace the asterisk in a date value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307784#M270639</link>
    <description>&lt;P&gt;I would be most appreciative for any help someone could give me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have date values in records where the data scanning process (for some reason) includes an asterisk within the date value. The date is converted to a string when it's scanned so the asterisk is allowed. I can convert the string date to a true date but I am faced with multiple errors because of the asterisks. I've tried various iterations of tranwrd and compress but I can't seem to get it right. I think, (perhaps mistakenly), that the asterisk is being treated as a wildcard in those functions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively I could simple exclude anything that is not a valid date since the imperfect scanning process gives me results such as:&lt;/P&gt;
&lt;P&gt;00/23/2009&lt;/P&gt;
&lt;P&gt;04/2 /90 9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help you might be able to provide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample data:&lt;/P&gt;
&lt;P&gt;*6/08/2009&lt;/P&gt;
&lt;P&gt;5/*1/2009&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2016 22:49:42 GMT</pubDate>
    <dc:creator>Jeff_DOC</dc:creator>
    <dc:date>2016-10-27T22:49:42Z</dc:date>
    <item>
      <title>How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307784#M270639</link>
      <description>&lt;P&gt;I would be most appreciative for any help someone could give me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have date values in records where the data scanning process (for some reason) includes an asterisk within the date value. The date is converted to a string when it's scanned so the asterisk is allowed. I can convert the string date to a true date but I am faced with multiple errors because of the asterisks. I've tried various iterations of tranwrd and compress but I can't seem to get it right. I think, (perhaps mistakenly), that the asterisk is being treated as a wildcard in those functions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively I could simple exclude anything that is not a valid date since the imperfect scanning process gives me results such as:&lt;/P&gt;
&lt;P&gt;00/23/2009&lt;/P&gt;
&lt;P&gt;04/2 /90 9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help you might be able to provide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample data:&lt;/P&gt;
&lt;P&gt;*6/08/2009&lt;/P&gt;
&lt;P&gt;5/*1/2009&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 22:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307784#M270639</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2016-10-27T22:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307785#M270640</link>
      <description>&lt;P&gt;You're using the right tools ... maybe just not quite in the right way. &amp;nbsp;Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;chardate = compress(chardate, '* ');&lt;/P&gt;
&lt;P&gt;numdate = input(chardate, mmddyy10.);&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 23:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307785#M270640</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-27T23:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307786#M270641</link>
      <description>&lt;P&gt;Thank you for the response but it doesn't work. It could be I have something else going on here. Here is what I used:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; temp_date = compress(date,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'*'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; surveydate = input(temp_date,&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;And here is what I got back:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Invalid argument to function INPUT at line 24 column 15.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;month=June2009 idnumber=111111111 date=06/04/* 77&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 23:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307786#M270641</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2016-10-27T23:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307796#M270642</link>
      <description>&lt;P&gt;Post the actual log. For example, what's the value of temp_date. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 00:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307796#M270642</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-28T00:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307815#M270643</link>
      <description>&lt;P&gt;Look very closely at&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt;&amp;nbsp;code sample. It includes both an asterisk AND a space in the arguments to the compress function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you modify your compress function it will work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look at the error in your log closely you'll see the extra space (red underscore here).&lt;/P&gt;
&lt;DIV id="sasLogNote1_1475049972139" class="sasNote"&gt;NOTE: Invalid argument to function INPUT at line 58 column 14.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;surveydate=. date=06/04/* 77 temp_date=06/04/&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;_&lt;/STRONG&gt;&lt;/FONT&gt;77 _ERROR_=1 _N_=1&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Oct 2016 02:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307815#M270643</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-28T02:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307824#M270644</link>
      <description>&lt;P&gt;You got&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;month=June2009&lt;/EM&gt; and &amp;nbsp;&lt;EM&gt;date=06/04/* 77&lt;/EM&gt;, are those two fields supposed to be related?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 03:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307824#M270644</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-10-28T03:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307931#M270645</link>
      <description>&lt;P&gt;Thanks for calling my attention to that. I didn't see it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate all your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 15:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307931#M270645</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2016-10-28T15:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace the asterisk in a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307933#M270646</link>
      <description>&lt;P&gt;Thank you. I appreciate all the help for everyone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy Friday.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 15:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-the-asterisk-in-a-date-value/m-p/307933#M270646</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2016-10-28T15:26:17Z</dc:date>
    </item>
  </channel>
</rss>

