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.


sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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