Help using Base SAS procedures

Error in proc export

Reply
Contributor
Posts: 35

Error in proc export

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.

Trusted Advisor
Posts: 2,113

Re: Error in proc export

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

Contributor
Posts: 35

Re: Error in proc export

Thank you very much Duke.

Trusted Advisor
Posts: 1,128

Re: Error in proc export

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
Contributor
Posts: 35

Re: Error in proc export

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.

Trusted Advisor
Posts: 1,128

Re: Error in proc export

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
Super User
Posts: 3,102

Re: Error in proc export

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.


Ask a Question
Discussion stats
  • 6 replies
  • 3642 views
  • 6 likes
  • 4 in conversation