<?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: Excel DateTime to SAS DateTime - have code - not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excel-DateTime-to-SAS-DateTime-have-code-not-working/m-p/737267#M229831</link>
    <description>&lt;P&gt;The 8. informat cuts off all digits after the first 8.&lt;/P&gt;
&lt;P&gt;Is the variable "created" in fact character, or is it numeric?&lt;/P&gt;
&lt;P&gt;If character, use the 32. informat (the maximum length) in the INPUT function; otherwise, use the variable as is.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 13:34:13 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-04-27T13:34:13Z</dc:date>
    <item>
      <title>Excel DateTime to SAS DateTime - have code - not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-DateTime-to-SAS-DateTime-have-code-not-working/m-p/737237#M229819</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following dates in a .xlsx file:&lt;/P&gt;&lt;P&gt;23Feb2021 15:57:13.00&lt;BR /&gt;23Feb2021 18:36:25.00&lt;BR /&gt;23Feb2021 18:52:04.00&lt;BR /&gt;23Feb2021 19:00:56.00&lt;BR /&gt;22Feb2021 16:44:40.00&lt;BR /&gt;24Feb2021 17:09:48.00&lt;BR /&gt;(their Excel numeric equivalents:)&lt;/P&gt;&lt;P&gt;44250.66473379629&lt;BR /&gt;44250.77528935185&lt;BR /&gt;44250.786157407405&lt;BR /&gt;44250.79231481481&lt;BR /&gt;44249.69768518519&lt;BR /&gt;44251.7151388889&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have the following code in a proc sql (having to input as the column is being read as character, due to &lt;EM&gt;actual&lt;/EM&gt; SAS formatted dates (datetime19.) being in the same column for some reason, and thus being treated as char):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select (input(Created,8.) - 21916)*86400 as Created_E format datetime19.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I get the following outputs in SAS:&lt;/P&gt;&lt;P&gt;23FEB2021:15:50:24&lt;BR /&gt;23FEB2021:18:28:48&lt;BR /&gt;23FEB2021:18:43:12&lt;BR /&gt;23FEB2021:18:57:36&lt;BR /&gt;22FEB2021:16:33:36&lt;BR /&gt;24FEB2021:17:02:24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why are my dates all around 5-11 minutes out, please?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 12:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-DateTime-to-SAS-DateTime-have-code-not-working/m-p/737237#M229819</guid>
      <dc:creator>_Dan_</dc:creator>
      <dc:date>2021-04-27T12:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Excel DateTime to SAS DateTime - have code - not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-DateTime-to-SAS-DateTime-have-code-not-working/m-p/737267#M229831</link>
      <description>&lt;P&gt;The 8. informat cuts off all digits after the first 8.&lt;/P&gt;
&lt;P&gt;Is the variable "created" in fact character, or is it numeric?&lt;/P&gt;
&lt;P&gt;If character, use the 32. informat (the maximum length) in the INPUT function; otherwise, use the variable as is.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 13:34:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-DateTime-to-SAS-DateTime-have-code-not-working/m-p/737267#M229831</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-27T13:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Excel DateTime to SAS DateTime - have code - not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-DateTime-to-SAS-DateTime-have-code-not-working/m-p/737276#M229836</link>
      <description>Thanks Kurt. You are, of course, correct; I'm having to ingest the column as character, but my misunderstanding of the input function on this occasion led me to believe I was limited to '8' because that's the maximum length of a numeric field. Extending this to 32 has of course resolved this issue. As soon as I saw your response I realise I'd come across this years ago and stumbled across this exact fix too. Lack of regular coding - rusty hands &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 27 Apr 2021 13:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-DateTime-to-SAS-DateTime-have-code-not-working/m-p/737276#M229836</guid>
      <dc:creator>_Dan_</dc:creator>
      <dc:date>2021-04-27T13:57:25Z</dc:date>
    </item>
  </channel>
</rss>

