<?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: Failed to change character into date in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Failed-to-change-character-into-date-in-SAS/m-p/183007#M46615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your second method should be correct. &lt;/P&gt;&lt;P&gt;One thought is trailing spaces so perhaps a compress or trim might help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;DateNew=input (compress(Date),DATE9.);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 17:08:28 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-01-14T17:08:28Z</dc:date>
    <item>
      <title>Failed to change character into date in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Failed-to-change-character-into-date-in-SAS/m-p/183006#M46614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I imported 5 excel files into SAS and there are some dates formatted as 8/3/1989 originally and formatted into 03Aug1989 (DATE9.) which is what I really want. However, on 1 file the dates failed to converted into DATE9. and it is read as $CHAR10 when I read the log. I tried several ways to reformat it into DATE9 but failed.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I tried to change all informat/format/input into DATE9. instead of $CHAR10 but failed, the results are all empty (.)&lt;/LI&gt;&lt;LI&gt;I tried&amp;nbsp; DateNew=input (Date,DATE9.);&amp;nbsp;&amp;nbsp; but it didn't work either.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any comment?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 16:52:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Failed-to-change-character-into-date-in-SAS/m-p/183006#M46614</guid>
      <dc:creator>kiddcao</dc:creator>
      <dc:date>2015-01-14T16:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to change character into date in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Failed-to-change-character-into-date-in-SAS/m-p/183007#M46615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your second method should be correct. &lt;/P&gt;&lt;P&gt;One thought is trailing spaces so perhaps a compress or trim might help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;DateNew=input (compress(Date),DATE9.);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 17:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Failed-to-change-character-into-date-in-SAS/m-p/183007#M46615</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-14T17:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to change character into date in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Failed-to-change-character-into-date-in-SAS/m-p/183008#M46616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HOW did you get the data from Excel? Proc Import has a number of issues with Excel depending on what people put in the Excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, look at the cell level formats in Excel. If they were set as character and the value entered as text '8/3/1989 they would likely come in as text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the values are 8/3/1989 then you want to use&lt;/P&gt;&lt;P&gt;DateNew = input(date, mmddyy10.);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Format DateNew date9.;&lt;/P&gt;&lt;P&gt;when use input(date,date9.) SAS expects the text value to look like 03Aug1989 not 8/3/1989.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 17:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Failed-to-change-character-into-date-in-SAS/m-p/183008#M46616</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-14T17:12:17Z</dc:date>
    </item>
  </channel>
</rss>

