<?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: Problem importing excel columns with time / datetime format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Problem-importing-excel-columns-with-time-datetime-format/m-p/338113#M63100</link>
    <description>&lt;P&gt;Not within PROC IMPORT but within a libname you can use DBSASTYPE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the XLSX engine if that's an option, available is SAS 9.3+&lt;/P&gt;</description>
    <pubDate>Sat, 04 Mar 2017 13:03:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-03-04T13:03:20Z</dc:date>
    <item>
      <title>Problem importing excel columns with time / datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-importing-excel-columns-with-time-datetime-format/m-p/338111#M63099</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;I have a problem importing an excel file, specifically related to a column which is time and another which is datetime&lt;/P&gt;
&lt;P&gt;I am trying to import an excel file using proc import:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
PROC IMPORT OUT= Data
            DATAFILE= "c:\Home\Desktop\data.xlsx"
            DBMS=EXCEL REPLACE ;
GETNAMES=YES;
MIXED=yes;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
Sheet='Sheet1';
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which works well, and the file is imported. However, the colums which are in time format in the excel file (yes, formated corectly in the excel file) are imported as date. Same thing happening with columns that are datetime in the excel file&lt;/P&gt;
&lt;P&gt;Even if i try to set the data to a new set and force a format on these columns, it dosent work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data Data2;
set Data;
format op_date_time datetime21.;
format op_time time8.;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I guess one way to solve this is importing excel files using libname solution. But is there a way with proc import to instruct SAS to the time/datetime nature of some of the columns&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Am&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 12:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-importing-excel-columns-with-time-datetime-format/m-p/338111#M63099</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2017-03-04T12:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing excel columns with time / datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-importing-excel-columns-with-time-datetime-format/m-p/338113#M63100</link>
      <description>&lt;P&gt;Not within PROC IMPORT but within a libname you can use DBSASTYPE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the XLSX engine if that's an option, available is SAS 9.3+&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 13:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-importing-excel-columns-with-time-datetime-format/m-p/338113#M63100</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-04T13:03:20Z</dc:date>
    </item>
  </channel>
</rss>

