<?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: Import excel with DateTime format in SAS Data Integration Studio in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536351#M147389</link>
    <description>Abandoning excel as data source is not an option? Such problems always arise, because excel is one of the worst file-formats for data storage. Excel lacks clear type definitions for columns, makeing it difficult for sas to guess the right type. &lt;BR /&gt;&lt;BR /&gt;Check the column: has any cell a type other than date?</description>
    <pubDate>Mon, 18 Feb 2019 06:26:36 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-02-18T06:26:36Z</dc:date>
    <item>
      <title>Import excel with DateTime format in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536305#M147360</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to import excel file using SAS Data Integration studio, that have 3 different columns with DateTime format. Among those 3 col's only 2 columns are reading in correct format other column is reading is as Character due to empty rows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Date1                              Date2                               Date3
Jan 11, 2019 12:17 PM        Jan 18, 2019 1:00 PM             
Jan 18, 2019 1:00 PM          Jan 11, 2019 9:23 PM            Jan 1, 2019 9:23 PM
Jan 11, 2019 12:17 PM        Jan 18, 2019 1:00 PM


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Date 1 and Date2 are reading in correctly without any issues&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But Date3 reads in as 43486.40625.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone suggest what to do to get it correct.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 00:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536305#M147360</guid>
      <dc:creator>ashna</dc:creator>
      <dc:date>2019-02-18T00:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel with DateTime format in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536335#M147380</link>
      <description>&lt;P&gt;1. Do you have strings in this column?&lt;/P&gt;
&lt;P&gt;2 .Did you read this &lt;A href="https://communities.sas.com/t5/SAS-Programming/Proc-import-xlsx-doesn-t-work-in-guessingrows/td-p/364561" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Proc-import-xlsx-doesn-t-work-in-guessingrows/td-p/364561&lt;/A&gt; ?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 03:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536335#M147380</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-02-18T03:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel with DateTime format in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536339#M147384</link>
      <description>&lt;P&gt;Nope, I don't have any strings in the column.&lt;/P&gt;&lt;P&gt;As mentioned before, few of the cells or observations in this column are empty.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 04:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536339#M147384</guid>
      <dc:creator>ashna</dc:creator>
      <dc:date>2019-02-18T04:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel with DateTime format in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536351#M147389</link>
      <description>Abandoning excel as data source is not an option? Such problems always arise, because excel is one of the worst file-formats for data storage. Excel lacks clear type definitions for columns, makeing it difficult for sas to guess the right type. &lt;BR /&gt;&lt;BR /&gt;Check the column: has any cell a type other than date?</description>
      <pubDate>Mon, 18 Feb 2019 06:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536351#M147389</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-02-18T06:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel with DateTime format in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536360#M147393</link>
      <description>&lt;P&gt;The usual advice: export to csv from Excel and read the file with a data step, so you keep control and get a consistent correct result.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 06:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536360#M147393</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-18T06:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel with DateTime format in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536605#M147476</link>
      <description>&lt;P&gt;1. You must have data in the third column. Even spaces are characters and can trigger reading the field as a character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t; 
  X=put(datetime(),datetime20.);output;
  X=' ';                        output;
run;
proc export data=t outfile="%sysfunc(pathname(WORK))\t.xlsx" dbms=xlsx replace; run;
proc import out=r datafile="%sysfunc(pathname(WORK))\t.xlsx" dbms=xlsx replace; run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. The value you are showing (is it a character?) is a valid excel date time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T; 
  EXCELDATE=43486.40625; 

  SASDATE=intnx('year',EXCELDATE,-60);
  put SASDATE date9.; 

  SASTIME= (EXCELDATE-int(EXCELDATE)) *60*60*24;
  put SASTIME= time.; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SASDATE=01JAN2019&lt;BR /&gt;SASTIME=9:45:00&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;3. Did you try option&amp;nbsp;&lt;SPAN&gt;DBSASTYPE&amp;nbsp;?&lt;/SPAN&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 22:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-with-DateTime-format-in-SAS-Data-Integration-Studio/m-p/536605#M147476</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-02-18T22:33:11Z</dc:date>
    </item>
  </channel>
</rss>

