Problem Note 36206: An error occurs when you use the IMPORT procedure to import a Microsoft Excel file that has the same name prefix as an Excel sheet
When you import an Excel worksheet with the IMPORT procedure, you can receive the following message:
NOTE: Data source is connected in READ ONLY mode.
ERROR: Unable to clear or re-assign the library _IMEX_ because it is still in
use.
ERROR: Error in the LIBNAME statement.
This error is generated when you submit a an IMPORT procedure similar to the following, even when you have full control over the Excel file:
proc import out=my-data
datafile= "c:\my-data\sas2b.xls"
dbms=excel replace;
sheet='Central$'n;
run;
The problem occurs when the print-area name in Excel has the same prefix as the Excel sheet name. To circumvent the problem, use the LIBNAME statement with the EXCEL engine, as shown here:
libname test excel 'c:\my-data\sas2b.xls' mixed=yes scantext=yes
usedate=no scantime=yes;
data temp1;
set test.'Central$'n;
run;
libname test clear;
Operating System and Release Information
SAS System | SAS/ACCESS Interface to PC Files | Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 | 9.3 TS1M0 |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | 9.3 TS1M0 |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | 9.3 TS1M0 |
Microsoft Windows XP Professional | 9.1 TS1M3 | 9.3 TS1M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
NOTE: Data source is connected in READ ONLY mode.
ERROR: Unable to clear or re-assign the library _IMEX_ because it is still in use.
ERROR: Error in the LIBNAME statement.
Type: | Problem Note |
Priority: | medium |
Topic: | Data Management ==> Data Sources ==> External Databases ==> MS Excel
|
Date Modified: | 2009-06-15 09:36:37 |
Date Created: | 2009-06-11 12:44:24 |