<?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: Date format problems importing from Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-format-problems-importing-from-Excel/m-p/347275#M273315</link>
    <description>&lt;P&gt;Without seeing the file its going to be hard to help. &amp;nbsp;Excel is a terrible data medium. &amp;nbsp;One thing that jumps to mind is EU/US date differences for instance: MM/DD/YY and DD/MM/YY.&lt;/P&gt;
&lt;P&gt;Is it possible that you have values in that column which could be interpreted either way? &amp;nbsp;Because&amp;nbsp;&lt;SPAN&gt;12/27/2016 would not be decodable to DD/MM/YY, but others might. &amp;nbsp;This might be confusing the "guessing" proc import program. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thats the only thing I can think off hand, however there could be any number of problems with an excel sheet - hidden things, hidden formats, differences in the data in&amp;nbsp;&lt;STRONG&gt;each&lt;/STRONG&gt; cell, just to name a few. Sounds like you have a real mess of a file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you can get the problem data, just a few rows, in a datastep (see:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;) then could suggest a input() function to convert it, as:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;d_var=input(c_var,mmddyy10.);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should work.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Apr 2017 09:51:15 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-04-05T09:51:15Z</dc:date>
    <item>
      <title>Date format problems importing from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-format-problems-importing-from-Excel/m-p/347272#M273314</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have imported an Excel (xlsx) dataset with 100+ variables, but one date&amp;nbsp;variable refuses to be recognised as a date by SAS 9.4.&amp;nbsp; I have formatted it&amp;nbsp;as a date&amp;nbsp;in Excel, repeatedly done the 'text to columns' procedure to specify it is a date, and&amp;nbsp;increased my guessingrows to well over the necessary amount.&amp;nbsp; I've&amp;nbsp;also tried&amp;nbsp;coping and pasting the&amp;nbsp;values only in a new column, and repeated everything above, and still can't get it to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get&amp;nbsp; NOTE: Invalid numeric data, date='12/27/2016' , at line&amp;nbsp;xxxx column x for every date entry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am unable to convert the file to CSV as I lose data in other columns (in other languages).&amp;nbsp; The&amp;nbsp;Excel file has&amp;nbsp;many date variables&amp;nbsp;and I can get them all to work except this one.&amp;nbsp; I've also tried formatting the variable in SAS but just get errors that the format cannot be loaded (Date9. or anything else) despite working fine in other procedures.&amp;nbsp;Any thoughts on what I can do?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 09:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-format-problems-importing-from-Excel/m-p/347272#M273314</guid>
      <dc:creator>Scout</dc:creator>
      <dc:date>2017-04-05T09:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Date format problems importing from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-format-problems-importing-from-Excel/m-p/347275#M273315</link>
      <description>&lt;P&gt;Without seeing the file its going to be hard to help. &amp;nbsp;Excel is a terrible data medium. &amp;nbsp;One thing that jumps to mind is EU/US date differences for instance: MM/DD/YY and DD/MM/YY.&lt;/P&gt;
&lt;P&gt;Is it possible that you have values in that column which could be interpreted either way? &amp;nbsp;Because&amp;nbsp;&lt;SPAN&gt;12/27/2016 would not be decodable to DD/MM/YY, but others might. &amp;nbsp;This might be confusing the "guessing" proc import program. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thats the only thing I can think off hand, however there could be any number of problems with an excel sheet - hidden things, hidden formats, differences in the data in&amp;nbsp;&lt;STRONG&gt;each&lt;/STRONG&gt; cell, just to name a few. Sounds like you have a real mess of a file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you can get the problem data, just a few rows, in a datastep (see:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;) then could suggest a input() function to convert it, as:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;d_var=input(c_var,mmddyy10.);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 09:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-format-problems-importing-from-Excel/m-p/347275#M273315</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-05T09:51:15Z</dc:date>
    </item>
  </channel>
</rss>

