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.
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
Thank you very much Duke.
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
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.
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
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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.