<?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: how to format time from excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/776003#M246706</link>
    <description>&lt;P&gt;This indicates that all variables are not the same type.&lt;/P&gt;
&lt;P&gt;I'd expect all 3 to be numeric. Please check that&amp;nbsp; they are. Use proc contents for example.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Oct 2021 05:29:19 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2021-10-23T05:29:19Z</dc:date>
    <item>
      <title>how to format time from excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/776001#M246704</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I prepare file for trading hours with beginning and close time of date.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;TD&gt;End&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;09:00:00&lt;/TD&gt;&lt;TD&gt;17:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08:30:00&lt;/TD&gt;&lt;TD&gt;14:52:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;09:00:00&lt;/TD&gt;&lt;TD&gt;13:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I import this file into SAS and merge it with trading hours. Then I code and got error:&lt;/P&gt;&lt;P&gt;where (localtime &amp;gt;= start and localtime &amp;lt;= end);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: WHERE clause operator requires compatible variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please advise how to make this code work? I tried to format time for START and END but the format time8. is not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Oct 2021 04:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/776001#M246704</guid>
      <dc:creator>thanhnguyenhtl</dc:creator>
      <dc:date>2021-10-23T04:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to format time from excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/776003#M246706</link>
      <description>&lt;P&gt;This indicates that all variables are not the same type.&lt;/P&gt;
&lt;P&gt;I'd expect all 3 to be numeric. Please check that&amp;nbsp; they are. Use proc contents for example.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Oct 2021 05:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/776003#M246706</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-10-23T05:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to format time from excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/776006#M246709</link>
      <description>&lt;P&gt;And where does Localtime come from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run Proc Contents or look at your variable properties in the SAS data set with your preferred method. One of those variables is not like the other in terms of variable type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The FORMAT of a variable has nothing to do with the result of comparisons. There are many formats that could display any given value but unless you force the format to be used such as with Put(somevar,Aformatname.) the underlying values of the variable are used for comparison not the appearance of the format.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Oct 2021 05:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/776006#M246709</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-23T05:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to format time from excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/777423#M247324</link>
      <description>&lt;P&gt;Did you find the error?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 21:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-format-time-from-excel/m-p/777423#M247324</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-10-29T21:56:26Z</dc:date>
    </item>
  </channel>
</rss>

