<?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 Reading an excel file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20084#M4158</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I've created an excel file using the following command in SAS 9.2&lt;BR /&gt;
ods tagsets.excelxp file="round.xls"&lt;BR /&gt;
                      style=sasweb&lt;BR /&gt;
                      options(embedded_titles='yes'&lt;BR /&gt;
                              embedded_footnotes='yes'&lt;BR /&gt;
                              sheet_interval='none'&lt;BR /&gt;
                              sheet_label=" ");&lt;BR /&gt;
&lt;BR /&gt;
Now I wanted to imported this round.xls file to work.round in SAS.  I tried the following code&lt;BR /&gt;
&lt;BR /&gt;
proc import &lt;BR /&gt;
   datafile = 'round.xls'&lt;BR /&gt;
   out      = work.round &lt;BR /&gt;
   dbms     = xls&lt;BR /&gt;
   replace; &lt;BR /&gt;
   getnames=yes;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I get the following error.&lt;BR /&gt;
&lt;BR /&gt;
File is not OLE2&lt;BR /&gt;
Requested Input File Is Invalid&lt;BR /&gt;
ERROR: Import unsuccessful.  See SAS Log for details.&lt;BR /&gt;
&lt;BR /&gt;
I tried different names for the input files.&lt;BR /&gt;
&lt;BR /&gt;
Please help.&lt;BR /&gt;
&lt;BR /&gt;
Sandhya.</description>
    <pubDate>Tue, 11 May 2010 19:31:40 GMT</pubDate>
    <dc:creator>Sandhya</dc:creator>
    <dc:date>2010-05-11T19:31:40Z</dc:date>
    <item>
      <title>Reading an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20084#M4158</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I've created an excel file using the following command in SAS 9.2&lt;BR /&gt;
ods tagsets.excelxp file="round.xls"&lt;BR /&gt;
                      style=sasweb&lt;BR /&gt;
                      options(embedded_titles='yes'&lt;BR /&gt;
                              embedded_footnotes='yes'&lt;BR /&gt;
                              sheet_interval='none'&lt;BR /&gt;
                              sheet_label=" ");&lt;BR /&gt;
&lt;BR /&gt;
Now I wanted to imported this round.xls file to work.round in SAS.  I tried the following code&lt;BR /&gt;
&lt;BR /&gt;
proc import &lt;BR /&gt;
   datafile = 'round.xls'&lt;BR /&gt;
   out      = work.round &lt;BR /&gt;
   dbms     = xls&lt;BR /&gt;
   replace; &lt;BR /&gt;
   getnames=yes;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I get the following error.&lt;BR /&gt;
&lt;BR /&gt;
File is not OLE2&lt;BR /&gt;
Requested Input File Is Invalid&lt;BR /&gt;
ERROR: Import unsuccessful.  See SAS Log for details.&lt;BR /&gt;
&lt;BR /&gt;
I tried different names for the input files.&lt;BR /&gt;
&lt;BR /&gt;
Please help.&lt;BR /&gt;
&lt;BR /&gt;
Sandhya.</description>
      <pubDate>Tue, 11 May 2010 19:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20084#M4158</guid>
      <dc:creator>Sandhya</dc:creator>
      <dc:date>2010-05-11T19:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20085#M4159</link>
      <description>My guess would be that this happens because the file you create is really a html (or is it xml?) file.  From what I have read the .xls just makes it so Excel is the default program to open the file.  Try opening the file, save it as an Excel file, and then try your proc import to see if this is correct (I'm no expert so it may be wrong).

Message was edited by: RickM</description>
      <pubDate>Tue, 11 May 2010 19:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20085#M4159</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-05-11T19:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20086#M4160</link>
      <description>Rick:&lt;BR /&gt;
  You are exactly correct. The file created by TAGSETS.EXCELXP is a Microsoft Office Spreadsheet Markup Language XML file that conforms to the Office 2002/2003 specification for XML description of a workbook/spreadsheet. &lt;BR /&gt;
&lt;BR /&gt;
  When someone uses .XLS as a file extension in an ODS TAGSETS.EXCELXP program, it is merely a convenience -- so Windows will launch Excel when they double click on a file with .XLS, Excel launches (instead of the browser, which is the default file open program for an XML file).&lt;BR /&gt;
&lt;BR /&gt;
  ODS TAGSETS.EXCELXP does NOT create a "true, binary" .XLS file -- so your advice to open the file in Excel and do a SAVE AS --&amp;gt;XLS (not just a SAVE -- which will save to XML format) -- was good advice. It is the only way to ensure that the file is a binary .XLS file. &lt;BR /&gt;
&lt;BR /&gt;
  (Also, if someone has Office 2007 and saves to the new .XLSX format, they can only read that file format with SAS using SAS 9.2 Phase 2 and Proc Import or the Excel Libname Engine).&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 11 May 2010 22:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20086#M4160</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-05-11T22:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20087#M4161</link>
      <description>one way to read a file created in microsoft spreadsheet mark-up language - (like these created by ODS tagsets.excelXP ) &lt;BR /&gt;
 - - - - - - - - -&amp;gt; use sas xml-Mapper  &lt;BR /&gt;
The version in SAS9.2 provides an "autoMap" feature that does most of the work. Then a bit of sql can de-normalise the tables (which starts looking like a database in 3rd normal form !) and it will provide you with the equivalent of the data sheets in plain CSV text&lt;BR /&gt;
  &lt;BR /&gt;
good luck.&lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 13 May 2010 13:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-an-excel-file/m-p/20087#M4161</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-05-13T13:35:22Z</dc:date>
    </item>
  </channel>
</rss>

