<?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 Time Values from XLS File in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571412#M161177</link>
    <description>Did you telling  PROC IMPORT the name of the SHEET to be read instead of the named RANGE when using DBMS=XLS?&lt;BR /&gt;</description>
    <pubDate>Fri, 05 Jul 2019 14:39:19 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-07-05T14:39:19Z</dc:date>
    <item>
      <title>Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571003#M161057</link>
      <description>&lt;P&gt;I am writing a program for some clients that reads in a couple of excel files.&amp;nbsp; I give them the option to read in xls or xlsx because some of the files they are downloading are still using an old process and only provide xls files.&amp;nbsp; When I try to import the files, it converts all the time values to 01MAR2019 regardless of the time and saves it in a date9. format.&amp;nbsp; Is there a way to get SAS to recognize the column as a time field and treat it accordingly?&amp;nbsp; Is there an option or something in my import block that is missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT= WORK.FILE1
            DATAFILE= "&amp;amp;dir.\&amp;amp;file1..xls" 
            DBMS=EXCELCS REPLACE;
     RANGE="Page1_1$"; 
     SCANTEXT=YES;
     USEDATE=YES;
     SCANTIME=YES;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 15:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571003#M161057</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2019-07-03T15:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571024#M161060</link>
      <description>&lt;P&gt;Perhaps the time part is still there.&amp;nbsp; Excel stores time as a fraction of a day. The date formats will just ignore the fractional part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do the values only contain integers?&lt;/P&gt;
&lt;P&gt;For example you could try this:&amp;nbsp; Assume that the variable is called DATE try this to create a new variable called TIME.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;time='24:00't*(date-int(date));
format time time.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What happens if don't add those options? Or make changes to them? There is an interaction between the SCANTIME and USERDATE options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=acpcref&amp;amp;docsetTarget=n0msy4hy1so0ren1acm90iijxn8j.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=acpcref&amp;amp;docsetTarget=n0msy4hy1so0ren1acm90iijxn8j.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 class="xis-argument"&gt;SCANTIME=YES | NO&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;specifies whether to scan the time data while importing data from a time column from the Microsoft Excel workbook.&lt;/P&gt;
&lt;DIV id="n0x3pqwwqfc34sn1h99u5up043mt" class="xis-paraSimple"&gt;YES scans the time column and assigns the TIME. format for a time column.&lt;/DIV&gt;
&lt;DIV id="n07xgrn6xy73xsn1w3yezvkrhmdx" class="xis-paraSimple"&gt;NO specifies not to scan the time column. The DATETIME format is assigned if USEDATE=NO. The TIME. format is assigned if USEDATE=YES.&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Jul 2019 16:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571024#M161060</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-03T16:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571037#M161063</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried your method, and it showed that all non-missing values are integers (i.e., TIME only produced zeroes).&amp;nbsp; As for the options I have in there, I have tried running with all combinations of options including no options at all.&amp;nbsp; It just didn't work.&amp;nbsp; This is not an urgent or vital issue.&amp;nbsp; Not that I want to just give up on something, but if we can't come to a solution, it won't ruin my employment status.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dallas&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 17:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571037#M161063</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2019-07-03T17:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571048#M161065</link>
      <description>&lt;P&gt;Do you have to use DBMS=EXCELCS?&lt;/P&gt;
&lt;P&gt;You could try reading the same file use DBMS=XLS or DBMS=XLSX and see if it handles the column better.&lt;/P&gt;
&lt;P&gt;Also check if all of the cells in the column are formatted (or whatever Excel calls) the same way. Perhaps some type of mixed types is causing the issue you see.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 18:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571048#M161065</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-03T18:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571049#M161066</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/74"&gt;@djbateman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An idea:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Have a look at input data. Proc import generates code that is written to the log, Copy the code to the program editor and modify it, so the time field is read as $22. and is without a format, and see what you get.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Copy a value and play with it in a small data step, until you find a usable informat, and if that is not possible, add some code to change it to a time value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Change the generated code from the import step and use that instead of proc import.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 18:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571049#M161066</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-07-03T18:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571223#M161130</link>
      <description>&lt;P&gt;Try option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MIXED=yes;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and hope turn time into character type and input it after data step .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 11:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571223#M161130</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-07-04T11:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571409#M161175</link>
      <description>&lt;P&gt;I played around with different options for DBMS.&amp;nbsp; XLS and EXCEL gave me an errors (see below for details).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Using DMBS=XLS&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;390 PROC IMPORT OUT= WORK.FILE1&lt;BR /&gt;391 DATAFILE= "&amp;amp;dir.\&amp;amp;file1..xls"&lt;BR /&gt;SYMBOLGEN: Macro variable DIR resolves to S:\cdm\Programming\Excel_Comments&lt;BR /&gt;SYMBOLGEN: Macro variable FILE1 resolves to VX17-445-105_FIRST_DOSE_(DOSEF)_04MAR2019&lt;BR /&gt;392 DBMS=XLS REPLACE;&lt;BR /&gt;393 RANGE="Page1_1$";&lt;BR /&gt;394 /* SCANTEXT=YES;*/&lt;BR /&gt;395 /* USEDATE=YES;*/&lt;BR /&gt;396 /* SCANTIME=YES;*/&lt;BR /&gt;397 RUN;&lt;/P&gt;
&lt;P&gt;Requested Range not found on Excel -&amp;gt;&lt;BR /&gt;S:\cdm\Programming\Excel_Comments\VX17-445-105_FIRST_DOSE_(DOSEF)_04MAR2019.xls&lt;BR /&gt;Requested Input File Is Invalid&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Using DMBS=EXCEL&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;415 PROC IMPORT OUT= WORK.FILE1&lt;BR /&gt;416 DATAFILE= "&amp;amp;dir.\&amp;amp;file1..xls"&lt;BR /&gt;SYMBOLGEN: Macro variable DIR resolves to S:\cdm\Programming\Excel_Comments&lt;BR /&gt;SYMBOLGEN: Macro variable FILE1 resolves to VX17-445-105_FIRST_DOSE_(DOSEF)_04MAR2019&lt;BR /&gt;417 DBMS=EXCEL REPLACE;&lt;BR /&gt;418 RANGE="Page1_1$";&lt;BR /&gt;419 SCANTEXT=YES;&lt;BR /&gt;420 USEDATE=YES;&lt;BR /&gt;421 SCANTIME=YES;&lt;BR /&gt;422 RUN;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ERROR: Connect: Class not registered&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;ERROR: Error in the LIBNAME statement.&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;Connection Failed. See log for details.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 3.09 seconds&lt;BR /&gt;cpu time 0.09 seconds&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 14:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571409#M161175</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2019-07-05T14:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571411#M161176</link>
      <description>&lt;P&gt;I tried MIXED=YES.&amp;nbsp; It doesn't seem to work.&amp;nbsp; I get the error messages below, and this is only after I changed DBMS to EXCEL.&amp;nbsp; If I leave it as EXCELCS, I get a different error saying that the statement is not valid or is not used in the proper order&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;449 PROC IMPORT OUT= WORK.FILE1&lt;BR /&gt;450 DATAFILE= "&amp;amp;dir.\&amp;amp;file1..xls"&lt;BR /&gt;SYMBOLGEN: Macro variable DIR resolves to S:\cdm\Programming\Excel_Comments&lt;BR /&gt;SYMBOLGEN: Macro variable FILE1 resolves to VX17-445-105_FIRST_DOSE_(DOSEF)_04MAR2019&lt;BR /&gt;451 DBMS=EXCEL REPLACE;&lt;BR /&gt;452 RANGE="Page1_1$";&lt;BR /&gt;453 SCANTEXT=YES;&lt;BR /&gt;454 USEDATE=YES;&lt;BR /&gt;455 SCANTIME=YES;&lt;BR /&gt;456 MIXED=YES;&lt;BR /&gt;457 RUN;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR: Connect: Class not registered&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR: Error in the LIBNAME statement.&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;Connection Failed. See log for details.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 2.65 seconds&lt;BR /&gt;cpu time 0.06 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 14:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571411#M161176</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2019-07-05T14:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571412#M161177</link>
      <description>Did you telling  PROC IMPORT the name of the SHEET to be read instead of the named RANGE when using DBMS=XLS?&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Jul 2019 14:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571412#M161177</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-05T14:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571414#M161178</link>
      <description>&lt;P&gt;Good catch.&amp;nbsp; I just changed RANGE to SHEET.&amp;nbsp; However, it made no difference.&amp;nbsp; If I play with DBMS, XLS and EXCEL give me errors.&amp;nbsp; If I keep it as EXCELCS, the code runs clean, but the time values are still all set to 01MAR2019.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 14:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571414#M161178</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2019-07-05T14:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571608#M161253</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The "Class not registered" error indicates that you have a bitness mismatch between SAS and Microsoft Excel.&amp;nbsp; The EXCEL engine requires the same bitness.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Can you post a sample XLS or XLSX file?&amp;nbsp; I made XLS and XLSX files with an Excel time value and PROC IMPORT correctly converts them to SAS time values using this code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file='C:\temp\time.xls'
  out=work.time_xls_xls
  dbms=xls
  replace;
run; quit;

proc import file='C:\temp\time.xls'
  out=work.time_xls_excelcs
  dbms=excelcs
  replace;
run; quit;


proc import file='C:\temp\time.xlsx'
  out=work.time_xlsx_xlsx
  dbms=xlsx
  replace;
run; quit;

proc import file='C:\temp\time.xlsx'
  out=work.time_xlsx_excelcs
  dbms=excelcs
  replace;
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2019 20:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571608#M161253</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2019-07-06T20:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571803#M161324</link>
      <description>&lt;P&gt;Vince,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&amp;nbsp; I tried your code where I attempted all 4 variations.&amp;nbsp; I noticed that all the DBMS=EXCELCS read in all the time values as 01MAR2019.&amp;nbsp; When I used DBMS=XLS or XLSX, the time values were all imported as 43525.xxxx.&amp;nbsp; I assume that 43525 is the unformated SAS date equivalent of 01MAR2019, but I'm not sure where the decimal values are coming from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached a sample of one of my files.&amp;nbsp; The problem I'm running into is with Column H "Time ~ First Dose Time".&amp;nbsp; But now that I'm writing this and looking more into the data, I believe the problem arises because there is an occasional entry of "N/A" in that column.&amp;nbsp; That must be what is throwing things off.&amp;nbsp; If I run the code on a file where all the N/As are removed (file also attached), it works as expected.&amp;nbsp; But what I don't understand is that Column G has a matching N/A for the adjacent date value, and those don't import wonky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So, I guess I have a new question.&amp;nbsp; How can I get SAS to import a time column when there are a few N/As sprinkled among the values?&lt;/STRONG&gt;&amp;nbsp; And will there be a way to get SAS to recognize a date or time variable that can automatically format it?&amp;nbsp; When I went back to my&amp;nbsp;original code (with DBMS=EXCELCS and SCANTEXT=YES; USEDATE=YES; SCANTIME=YES;) I end up with the same 01MAR2019 value for all times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dallas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571803#M161324</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2019-07-08T14:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571812#M161326</link>
      <description>&lt;P&gt;Vince,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should have summarized with code what I did and the outcomes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My original file with DBMS=XLS produces the time variable with 43525.xxxx&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file='C:\\XLS_DOSEF_SAMPLE.xls'
			out=work.time_xls_xls dbms=xls replace;
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All the N/As removed using DBMS=XLS properly produces a time value, but it is unformatted, and in practice, I won't know which variables are dates or times or anything like that, so I would like these to be formatted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file='C:\XLS_DOSEF_SAMPLE_noNA.xls'
			out=work.time_xls_xls_noNA dbms=xls replace;
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All the N/As removed using DBMS=EXCELCS just brings me back to my original issue where all the time values are read in as 01MAR2019.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file='C:\XLS_DOSEF_SAMPLE_noNA.xls'
			out=work.time_xls_excelcs dbms=excelcs replace;
		     SHEET="Page1_1$"; 
		     SCANTEXT=YES;
		     USEDATE=YES;
		     SCANTIME=YES;
run; quit;&lt;/CODE&gt;&lt;/PRE&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;
&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, 08 Jul 2019 15:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571812#M161326</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2019-07-08T15:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Import Time Values from XLS File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571817#M161329</link>
      <description>&lt;P&gt;If you have mixed character and numeric values in the same column then SAS will create the variable as character.&amp;nbsp; The date/time values from Excel will then show up as the decimal string that represents the internal way that Excel stores dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I said before Excel stores time as percent of 24 hours.&amp;nbsp; So the code I posted before should work, once you have converted the string into a number.&amp;nbsp; The integer part is the number of days (as Excel counts them) since 1900.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of how to deal with those strings.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xx;
  input time_string $20.;
  time='24:00't*mod(input(time_string,??32.),1);
  format time time.;
  put (_all_) (=/);
cards;
43525.5
43525.125
43525.250
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Time-Values-from-XLS-File/m-p/571817#M161329</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-08T15:17:35Z</dc:date>
    </item>
  </channel>
</rss>

