<?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 SCANTIME=YES|NO in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/443866#M111088</link>
    <description>&lt;P&gt;SCANTIME=YES|NO&lt;BR /&gt;specifies whether to scan all row values in a date/time column and automatically determine the TIME. format if only time&lt;BR /&gt;values exist.&lt;BR /&gt;YES specifies that a column with only time values be assigned the TIME8. format.&lt;BR /&gt;NO specifies that a column with only time values be assigned the DATE9. format.&amp;nbsp; &amp;lt;----- ?????&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This doesn't seem to make sense to me.&amp;nbsp; Is it correct? Why would I want a DATE9. format on a column with only time values?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your INPUT.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Mar 2018 19:06:39 GMT</pubDate>
    <dc:creator>evp000</dc:creator>
    <dc:date>2018-03-08T19:06:39Z</dc:date>
    <item>
      <title>SCANTIME=YES|NO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/443866#M111088</link>
      <description>&lt;P&gt;SCANTIME=YES|NO&lt;BR /&gt;specifies whether to scan all row values in a date/time column and automatically determine the TIME. format if only time&lt;BR /&gt;values exist.&lt;BR /&gt;YES specifies that a column with only time values be assigned the TIME8. format.&lt;BR /&gt;NO specifies that a column with only time values be assigned the DATE9. format.&amp;nbsp; &amp;lt;----- ?????&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This doesn't seem to make sense to me.&amp;nbsp; Is it correct? Why would I want a DATE9. format on a column with only time values?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your INPUT.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 19:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/443866#M111088</guid>
      <dc:creator>evp000</dc:creator>
      <dc:date>2018-03-08T19:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: SCANTIME=YES|NO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/443884#M111090</link>
      <description>&lt;P&gt;SCANTIME=NO means that the column will be given a DATETIME. format. This means that if it effectively contains time values, they will appear as 01JAN1960:hh:mm:ss&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/443884#M111090</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-03-08T20:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: SCANTIME=YES|NO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/443904#M111094</link>
      <description>&lt;P&gt;SCANTIME=YES|NO is used because your excel file may shows time format even though the data is datetime value. In excel if we have a column as time format, even we can add datetime data in that column which shows only time in cell. In this situation when importing into SAS you need to tell SAS about the data in Excel. This may be confusing, let me explain briefly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 1: I have a Excel file with column Time only (see the formula tab for exact value stored in the cell )&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Time.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19063iA8BA9B3F60BE9298/image-size/large?v=v2&amp;amp;px=999" role="button" title="Time.PNG" alt="Time.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now lets see what happens when we&amp;nbsp;import this file using SCANTIME=NO|YES along with USEDATE=YES|NO.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Analysis.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19065i1CB7CA2110BB6975/image-size/large?v=v2&amp;amp;px=999" role="button" title="Analysis.png" alt="Analysis.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 2: If you have time values in excel that are actually datetime (See the formula tab in excel)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DateTime.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19066iD242C6C70AB1395E/image-size/large?v=v2&amp;amp;px=999" role="button" title="DateTime.PNG" alt="DateTime.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;In this file the first 4 values are just time, where as the last value is datetime value. So in this situation you need to use SCANTIME=YES|NO and USEDATE=YES|NO to tell SAS whether you need the time values or Date values for the Excel file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Analysis.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19067i899906F735F954C8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Analysis.png" alt="Analysis.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conclusion: If you have all the values in excel as TIME then you can read the values as TIME format in SAS or if they are datetime then you can read them into SAS as DATETIME or DATE9.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: In Excel if the cell shows as time there may be a date value hidden, which you can see in formula tab (see screenshot above).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this explains!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 21:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/443904#M111094</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-03-08T21:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: SCANTIME=YES|NO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/444210#M111170</link>
      <description>&lt;P&gt;So...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;original value&amp;nbsp; &amp;nbsp; &amp;nbsp; scantime&amp;nbsp; &amp;nbsp; &amp;nbsp; format**&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SAS value&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; appears as&lt;/P&gt;
&lt;P&gt;01:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YES&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3600 (seconds)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01:00&lt;/P&gt;
&lt;P&gt;01:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;datetime&amp;nbsp; &amp;nbsp; 3600 (seconds)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01JAN1960:01:00:00&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And this situation would not occur:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;01:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n/ap&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;date.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.041(days)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this correct?&amp;nbsp; So I guess the confusion comes from the fact that they specified DATE. rather than DATETIME..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;**There's confusion on my part about whether this is actually a format or an informat.&amp;nbsp; The SCAN option is telling SAS how to read the data from Excel, right?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 18:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/444210#M111170</guid>
      <dc:creator>evp000</dc:creator>
      <dc:date>2018-03-09T18:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: SCANTIME=YES|NO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/444212#M111172</link>
      <description>&lt;P&gt;Thank you for your elaborate response.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the 2nd example, we're getting erroneous (made up) dates, when the date isn't specified&amp;nbsp;so that's a case where we'd need to make sure we're only getting the time part.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I've been doing forever is reading all questionable source data as character and dealing with it in SAS, as opposed to trying to manage an import process that could contain weird values.&amp;nbsp; I still believe that this is the way to go.&amp;nbsp; I want to see what's actually in there, regardless of Excel formatting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This does help me understand the process though.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 18:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCANTIME-YES-NO/m-p/444212#M111172</guid>
      <dc:creator>evp000</dc:creator>
      <dc:date>2018-03-09T18:50:19Z</dc:date>
    </item>
  </channel>
</rss>

