BookmarkSubscribeRSS Feed
Smudge
Calcite | Level 5
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.
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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
Smudge
Calcite | Level 5
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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Discussion stats
  • 2 replies
  • 877 views
  • 0 likes
  • 2 in conversation