<?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: Read an Excel File in Linux in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80829#M17401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help regarding this, we will be using the proc import statement and xls files going forward. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2012 19:20:08 GMT</pubDate>
    <dc:creator>bream_bn</dc:creator>
    <dc:date>2012-06-13T19:20:08Z</dc:date>
    <item>
      <title>Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80822#M17394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone had an luck using SAS to read an excel file on a linux installation of SAS? I have been searching all morning but have not had any luck finding significant information. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 15:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80822#M17394</guid>
      <dc:creator>bream_bn</dc:creator>
      <dc:date>2012-06-12T15:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80823#M17395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to do it with SAS/Access to PC Files.&amp;nbsp; Have you tried that?&amp;nbsp; You can't do it with just base SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A workaround would be to save the Excel file as a .CSV format on the PC side and then ftp that to Linux for processing; ugly, but effective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 19:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80823#M17395</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2012-06-12T19:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80824#M17396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SAS PC Files server must be running on a windows server though correct? The excel files are essentially uploaded to a linux server where which have web applications and SAS running on it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 19:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80824#M17396</guid>
      <dc:creator>bream_bn</dc:creator>
      <dc:date>2012-06-12T19:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80825#M17397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you use the workaround ... save to a file and upload ... I usually take a 3-program approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get an idea of what's in the data.&amp;nbsp; Here's the key part of this first program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile whatever;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;if _n_ &amp;lt; 10 then list;&lt;/P&gt;&lt;P&gt;else stop;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second program would actually attempt to read in the data.&amp;nbsp; It would allow extra length for storing each variable, and would measure how many characters are actually needed.&amp;nbsp; An abbreviation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test_length;&lt;/P&gt;&lt;P&gt;infile whatever firstobs=2 dlm='09'x dsd;&amp;nbsp; /* skip the header line, and use tabs as delimiters */&lt;/P&gt;&lt;P&gt;length var1 $ 50 var2 $ 20;&lt;/P&gt;&lt;P&gt;input var1 var2;&lt;/P&gt;&lt;P&gt;len_var1 = lengthn(var1);&lt;/P&gt;&lt;P&gt;len_var2 = lengthn(var2);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=test_length min max maxdec=0;&lt;/P&gt;&lt;P&gt;var len_:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The third program would shorten the lengths to what is necessary.&amp;nbsp; It would read in the data and save it as a SAS data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 19:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80825#M17397</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-06-12T19:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80826#M17398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The PC Files server is OPTIONAL.&amp;nbsp; It adds substantially more options for handling excel files in linux, but it is not necessary to have the actual server running on a windows machine.&amp;nbsp; You still have two options assuming you have a valid license for SAS ACCESS for PC Files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;libname x excel '/tmp/excel.xls';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data blah;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set x.sheet_1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc import datafile '/tmp/excel.xls'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;out=blah&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;dbms=xls; /* under 64-bit you are limited to only using this dbms without the server (EXCELCS) in 9.2 this does not support xlsx or xlsb, I am not sure about 9.3 */&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003103761.htm" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003103761&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 20:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80826#M17398</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-06-12T20:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80827#M17399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The proc import statement works as stated, the excel engine does not work though even though I have installed SAS Access to the PC Files. Also in order to use the proc import statement with dbms=xls does SAS Access for PC Files need to be installed? I could test this but it would require me to uninstall PC Files &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 16:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80827#M17399</guid>
      <dc:creator>bream_bn</dc:creator>
      <dc:date>2012-06-13T16:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80828#M17400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I said, SAS Access for PC Files is required, the PC Files Server (part of the SAS Access for PC Files) is the optional piece.&amp;nbsp; Without SAS Access for PC Files installed and licensed you options are to convert the file to an alternative dbms, such as CSV or TAB using an external utility and then reading that file into SAS.&amp;nbsp; If you do not know if you have SAS Access for PC Files run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13396036788866350" jivemacro_uid="_13396036788866350"&gt;
&lt;P&gt;PROC SETINIT; RUN:&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then review the data it presents in your log.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 16:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80828#M17400</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-06-13T16:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read an Excel File in Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80829#M17401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help regarding this, we will be using the proc import statement and xls files going forward. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 19:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-an-Excel-File-in-Linux/m-p/80829#M17401</guid>
      <dc:creator>bream_bn</dc:creator>
      <dc:date>2012-06-13T19:20:08Z</dc:date>
    </item>
  </channel>
</rss>

