<?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 data and time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415131#M101789</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/58513"&gt;@DmytroYermak&lt;/a&gt; wrote:&lt;BR /&gt;The matter is that I should not change so called 'raw' data outside sas.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Bullshit. Sorry for the harsh word, but that's what it is. You only READ the Excel, and then save to CSV in a location of your choosing. No change to the original file or its location.&lt;/P&gt;
&lt;P&gt;With a proper Office suite (like Libreoffice), such a conversion can even be done from the commandline and therefore out of SAS by using filename pipe, X, or call system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This conversion actually makes your import process into SAS more transparent and stable. Directly importing from Excel will always be the less efficient and less safe method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2017 11:49:24 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-11-21T11:49:24Z</dc:date>
    <item>
      <title>Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415118#M101777</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help to import correctly the following data and time from .xlsx file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here below is the format of data and time:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.jpg" style="width: 256px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16759iE85985060E33EE7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The real format of keeping is:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.jpg" style="width: 133px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16760i995BF04C2ADB5F42/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.jpg" style="width: 127px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16761i2D84B4EF44EAF6A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.jpg" alt="3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is as following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out= WORK.LABDATA
            datafile = "C:\Projects\lab.xlsx"
            dbms = XLSX REPLACE ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to import the data and time directly into correct sas format?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 10:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415118#M101777</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-11-21T10:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415120#M101779</link>
      <description>&lt;P&gt;Well, as with any question regarding Excel first and foremost, Excel is a really poor data format, which is why so many end users - not those who just use the front end - have so many issues with it.&amp;nbsp; The best method would be to convert it to CSV, then write a datastep import step, which reads in each data item specifying its informat, format, length, and label.&amp;nbsp; This is then reproducable, clean, and has no guessing component.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you will continue using Excel and proc import no doubt, so you can try some of the options (from a quick search):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/Proc-import-with-excel-date-field/td-p/42250" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Proc-import-with-excel-date-field/td-p/42250&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;however do bear in mind you will always have issues with Excel file formats.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415120#M101779</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-21T11:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415123#M101782</link>
      <description>Thank you, RW9. Is it possible to convert xlsx into csv in sas? I have not found any appropriate links (. The matter is that I should not change so called 'raw' data outside sas.</description>
      <pubDate>Tue, 21 Nov 2017 11:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415123#M101782</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-11-21T11:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415124#M101783</link>
      <description>&lt;P&gt;No, you would save the XLSX file as CSV.&amp;nbsp; This:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;The matter is that I should not change so called 'raw' data outside sas."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Has no real meaning, to move the data in from Excel to SAS you are changing it, be this by changing XLSX format to sas7bdat or via CSV.&amp;nbsp; If utilizing&amp;nbsp;Excel functionality on an Excel file is not permitted, then the question arises why is Excel being used in the first place.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415124#M101783</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-21T11:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415126#M101784</link>
      <description>&lt;P&gt;Actually I have used standard import procedure and the main issue I have faced is that the time was imported as character:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.jpg" style="width: 229px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16762i6261149F84C672F9/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.jpg" alt="4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can it be converted into hh:mm:ss ?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415126#M101784</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-11-21T11:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415127#M101785</link>
      <description>&lt;P&gt;Aside from the fact we are changing the RAW data &lt;span class="lia-unicode-emoji" title=":monkey_face:"&gt;🐵&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excel stores times as fractions of a day:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://excel.officetuts.net/en/training/how-excel-stores-date-and-time" target="_blank"&gt;http://excel.officetuts.net/en/training/how-excel-stores-date-and-time&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to convert you would need something like:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  real_time=input(excel_time,best.) * (24*60*60);
  format real_time time5.;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415127#M101785</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-21T11:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415129#M101787</link>
      <description>&lt;P&gt;Thank you for the help,RW9. I have been allowed to&amp;nbsp;convert the file into csv and your post was one of the arguments ).&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:48:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415129#M101787</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-11-21T11:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Import excel data and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415131#M101789</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/58513"&gt;@DmytroYermak&lt;/a&gt; wrote:&lt;BR /&gt;The matter is that I should not change so called 'raw' data outside sas.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Bullshit. Sorry for the harsh word, but that's what it is. You only READ the Excel, and then save to CSV in a location of your choosing. No change to the original file or its location.&lt;/P&gt;
&lt;P&gt;With a proper Office suite (like Libreoffice), such a conversion can even be done from the commandline and therefore out of SAS by using filename pipe, X, or call system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This conversion actually makes your import process into SAS more transparent and stable. Directly importing from Excel will always be the less efficient and less safe method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 11:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-excel-data-and-time/m-p/415131#M101789</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-21T11:49:24Z</dc:date>
    </item>
  </channel>
</rss>

