SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

libname excel - is this really an excel 97 file?

Reply
New Contributor
Posts: 2

libname excel - is this really an excel 97 file?

I am working with SAS 9.1.3 for windows and am using SAS to create an Excel workbook with several worksheets using -

libname myxl excel path=""

My excel file is then to be read in by a java application which is looking for an excel 97 workbook.

Unfortunately the java application cannot read the xls file created by my SAS code. However, if I open the xls file in excel and then save it as an excel 97 file then my java application has no trouble reading it. I also notice that when I do this the size of the file roughly doubles.

Is SAS really creating an excel file when I use the above libname statement or just something that can be read by Excel 97 ?
Is there anything I can do to create a proper excel 97 file from SAS ?

Many thanks in advance for any help.
SAS Super FREQ
Posts: 8,646

Re: libname excel - is this really an excel 97 file?

Hi:
It says here the the default value for the LIBNAME Engine is 97:
http://support.sas.com/documentation/cdl/en/acpcref/61891/HTML/default/a003077073.htm
in the discussion of the VERSION= option.

But that is the 9.2 documentation. I don't know whether it was different in SAS 9.1.3. You might wish to check with Tech Support on that question.

You could also just try an explicit VERSION= option.
[pre]
libname myxl excel "c:\temp\mywb.xls" version=97;
[/pre]

I never use the PATH= option on Windows, which is why I didn't show it above. I most often see it used when creating Excel files on UNIX and using PATH=, PORT= and USER= to connect to a Windows server. As described here:
http://support.sas.com/documentation/cdl/en/acpcref/61891/HTML/default/a002644677.htm

cynthia
New Contributor
Posts: 2

Re: libname excel - is this really an excel 97 file?

I've tried VER=97 and it makes no difference - the file is still smaller than when I open it in excel and resave as excel 97 and it still can't be read by the java app.

As a quick fix I've now used DDE to get SAS to use excel to open and resave in excel 97 format. It does the job but isn't ideal.

All the reading I have done seams to suggest that libname excel should create proper xls files whereas other methods just create something like HTML that can be read by excel. However there is definitely something odd going on.
Post a Question
Discussion Stats
  • 2 replies
  • 127 views
  • 0 likes
  • 2 in conversation