BookmarkSubscribeRSS Feed
sampath
Calcite | Level 5

Hi,

I am trying to create excel file using my data  in unix environment and I have used following code.

proc export data=dm outfile="/sap/kvp/dm.xls"

  dbms=excel replace;

run;

But I am getting following error:

Error: DBMS type EXCEL not valid for export.

I also tried

proc export data=dm outfile="/sap/kvp/dm.xls"

  dbms=xls replace;

run;

I got following error.

Error: DBMS type xls not valid for export.

Please help.

Thanks,

Sam.

6 REPLIES 6
Doc_Duke
Rhodochrosite | Level 12

you need to license SAS/Access to PC FIle formats on Unix to do this.  Otherwise, just export to a .csv file and read that on the PC.  See

SAS/ACCESS(R) 9.2 Interface to PC Files: Reference, Second Edition

Doc Muhlbaier

Duke

sampath
Calcite | Level 5

Thank you very much Duke.

Jagadishkatam
Amethyst | Level 16

Hi Sam,

As Duke rightly said it could be an license issue. However you can try alternative ways of exporting your data to excel. please fine below few examples.

i have used output delivery system for exporting the data to excel. hope this helps you.

ods html file="location\example.xls";

proc print data=library.name;

run;

ods html close;

Another example is as follows:

ods listing close;

ods tagsets.excelxp file="location\example.xml";

proc print data=library.name;

run;

ods tagsets.excelxp close;

ods listing;

Thanks,

Jagadish

Thanks,
Jag
sampath
Calcite | Level 5

Thank you very much Jagadish. That was really helpful. However after using ods tagsets the file that was created was xml file and with features different from actual xls file. I am wondering if there is any way to convert this xml file to xls file. 

Thanks,

Sam.

Jagadishkatam
Amethyst | Level 16

Hi Sam,

There is another method i think which will work for you,

using libname, please try the below code

libname mylib "location\example.xls";

data mylib.datasetname;

set library.name;

libname mylib clear;

Thanks,

Jagadish

Thanks,
Jag
SASKiwi
PROC Star

One simple way to convert an XML spreadsheet to XLS is just to do a "File Save As" after opening the spreadsheet in Excel.

To check if you have SAS/ACCESS Interface to PC Files licensed:

proc setinit noalias;

run;

If you do have it licensed then you also need to install the PC File Server software on a Windows computer (free download from SAS). This will accept your Excel export requests from your Unix server to produce the actual spreadsheets.


hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 7138 views
  • 6 likes
  • 4 in conversation