ODBC errors might occur when you use the EXCELCS engine to export SASĀ® output to Excel


In the UNIX or Windows 64 environment, when you use the EXCELCS engine to export SAS output to Excel you can receive the following error:

ERROR: The ODBC table class has been opened for OUTPUT. This table already exists, or there is a name conflict with an existing object. This table will not be replaced. This engine does not support the REPLACE option.

The error message will occur if the Excel file already exists and an attempt to replace the Excel file is attempted. The error occurs despite the fact that the REPLACE option is specified in the EXPORT procedure.

The problem occurs when the name of the Excel file (.xls) is not specified or if the filename does not have the .xls extension in the OUTFILE= option, as shown in this example:

proc export data=sashelp.class dbms=excelcs
outfile="\\network-name\directory\my-file" replace;
port=8621;
server='your-server';
sheet='class';
run;

To resolve the problem, specify the name of the Excel file or the extension in the OUTFILE= option, as shown in this example:

proc export data=sashelp.class dbms=excelcs
outfile="\\network-name\directory\my-file.xls" replace;
port=8621;
server='your-server';
sheet='class';
run;

On Windows operating systems, the EXCEL engine replaces a default Excel file; however, the EXCELCS engine does not replace such a file.