BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GeorgeBonanza
Obsidian | Level 7

I want to export a SAS dataset from UNIX server to LAN as an Excel file but I want the Excel workbook to be created if it doesn't already exist. 

 

The first export works and the ".xls" file is created when it doesn't exist.

 

However, I am concerned that the dataset might exceed the ~ 65000 rows in a ".xls" file so I would prefer to be able to export the data as ".xlsx". 

 

The second export does not work when I try to export as ".xlsx" file unless I manually create a blank workbook called "Want.xlsx" before running the export.

 

I am working in SAS Enterprise Guide 6.1.  Any help would be greatly appreciated.  Thanks in advance.

PROC EXPORT DATA= work.HAVE
	OUTFILE= "\\LAN\WANT.xls"
	DBMS= EXCELCS REPLACE;
	SERVER=SERVERNAME; PORT=0001;
	SERVERUSER="USRDOM\&USER"; SERVERPASS="&PW";
	SHEET= "OUTPUT";
RUN;

PROC EXPORT DATA= work.HAVE
	OUTFILE= "\\LAN\WANT.xlsx"
	DBMS= EXCELCS REPLACE;
	SERVER=SERVERNAME; PORT=0001;
	SERVERUSER="USRDOM\&USER"; SERVERPASS="&PW";
	SHEET= "OUTPUT";
RUN;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Try DBMS=EXCEL or DBMX=XLSX instead of DBMS=EXCELCS. EXCELCS expects to write to XLS not XLSX.

 

Since your EG is a couple of versions behind your server may be as well. I don't remember exactly when XLSX became available so not sure which should work.

View solution in original post

1 REPLY 1
ballardw
Super User

Try DBMS=EXCEL or DBMX=XLSX instead of DBMS=EXCELCS. EXCELCS expects to write to XLS not XLSX.

 

Since your EG is a couple of versions behind your server may be as well. I don't remember exactly when XLSX became available so not sure which should work.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 1705 views
  • 0 likes
  • 2 in conversation