Problem Note 16931: ERROR: Prepare: Invalid bracketing of name ' worksheet name$' Using
Import Wizard to Read Excel
Using Proc Import to read an Excel worksheet with a name that
begins with a space can return the following error:
ERROR 22-322: Syntax error, expecting one of the following:
;, (, DATAFILE, DATATABLE, DBMS, FILE, OUT, REPLACE, TABLE.
ERROR 76-322: Syntax error, statement will be ignored.
Using the Import Wizard to read the same Excel worksheet results
in the following error:
ERROR: Prepare: Invalid bracketing of name ' For eloader-sas$'.
SQL statement: SELECT * FROM ` worksheet name$`
ERROR: Import unsuccessful. See SAS Log for details.
This behavior has been identified as a limitation of the
SAS Import Procedure.
Users can use the Libname-Excel engine and refer to the
worksheet names that begin with a space like this:
libname myxls 'c:\desktop\class.xls';
data work.test;
set myxls."' class$'"n;
run;
Using RANGE= instead of SHEET= in the Proc Import code may
also succeed, e.g.
proc import datafile="c:\test.xls"
out=test
range=" name";
dbms=Excel replace;
getnames=yes;
run;
Operating System and Release Information
SAS System | SAS/ACCESS Interface to PC Files | Microsoft Windows NT Workstation | 9.1 TS1M3 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 | |
Microsoft Windows XP Professional | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
*
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.
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2008-03-04 15:02:20 |
Date Created: | 2006-01-24 10:53:57 |