<?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 importing date incorrectly in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782648#M39896</link>
    <description>&lt;P&gt;Read into a temporary character variable, then force correct informats for the parts of the string:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data weather;
infile
  "/home/kurt.bremser/Tutorial1 - Hourly Weather Data.csv"
  dlm=","
  dsd
  truncover
  firstobs=2
;
input _datetime_local :$16.;
datetime_local = dhms(
  input(scan(_datetime_local,1," "),ddmmyy10.),
  0,0,
  input(scan(_datetime_local,2," "),time5.)
);
format datetime_local e8601dt19.;
drop _datetime_local;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 27 Nov 2021 08:49:46 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-11-27T08:49:46Z</dc:date>
    <item>
      <title>SAS importing date incorrectly</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782638#M39893</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to import a CSV file which has a column with date/time values as such:&amp;nbsp;01-10-2019 00:00 (as in October 1st, 2019, 12 AM). However, every time I try to import the data "01-10-2019 00:00" turns to "10JAN19:00:00:00" instead of "01OCT19:00:00:00". I've tried changing the date format in the import wizard, and it either does nothing or ends up messing up the data (replacing date values with "."). What's confusing to me is that the suggested/automatically chosen date format gives the example of "10MAR99:12:34:56" which is what I need, but then still imports it incorrectly. Any ideas how to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rfurtuna_2-1637985941719.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66139i431E6649ABC17DD4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rfurtuna_2-1637985941719.png" alt="rfurtuna_2-1637985941719.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Data attached. Am on version&amp;nbsp;7.15 HF9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Sat, 27 Nov 2021 04:07:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782638#M39893</guid>
      <dc:creator>rfurtuna</dc:creator>
      <dc:date>2021-11-27T04:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS importing date incorrectly</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782641#M39894</link>
      <description>&lt;P&gt;Why do you think 01-10-2019 means First of October instead of January Tenth?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is your current setting for the DATESTYLE option?&lt;/P&gt;
&lt;P&gt;If it is set to LOCALE then what is the current setting of the LOCALE option?&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>Sat, 27 Nov 2021 05:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782641#M39894</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-27T05:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS importing date incorrectly</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782648#M39896</link>
      <description>&lt;P&gt;Read into a temporary character variable, then force correct informats for the parts of the string:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data weather;
infile
  "/home/kurt.bremser/Tutorial1 - Hourly Weather Data.csv"
  dlm=","
  dsd
  truncover
  firstobs=2
;
input _datetime_local :$16.;
datetime_local = dhms(
  input(scan(_datetime_local,1," "),ddmmyy10.),
  0,0,
  input(scan(_datetime_local,2," "),time5.)
);
format datetime_local e8601dt19.;
drop _datetime_local;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Nov 2021 08:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782648#M39896</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-27T08:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS importing date incorrectly</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782699#M39897</link>
      <description>&lt;P&gt;I ran:&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options datestyle=dmy;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it fixed the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Why do you think 01-10-2019 means First of October instead of January Tenth?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thats the way it was interpreted in the tutorial. It also makes more sense to me for the time variable to be 24 hours per consecutive day in October, as opposed to 24 hours of January 10th, then 24 hours of Febuary 10th, and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Nov 2021 21:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-importing-date-incorrectly/m-p/782699#M39897</guid>
      <dc:creator>rfurtuna</dc:creator>
      <dc:date>2021-11-27T21:24:03Z</dc:date>
    </item>
  </channel>
</rss>

