Usage Note 40953: Bracket characters in labels can cause "Syntax error in field definition" error when exporting to Excel
When exporting SAS data to Excel using the EXPORT procedure with the DBLABEL= option, you can receive the following error:
ERROR: Error attempting to CREATE a DBMS table.
ERROR: Execute: Syntax error in field definition.
The problem is likely to occur if there are bracket characters in the label as shown in this sample below:
data temp1;
set sashelp.class;
label age = '[age bracket]';
run;
proc export data=temp1 outfile='c:\sastest\myfilenew.xls'
dbms=excel replace;
newfile=yes;
dbdsopts='dblabel=yes';
run;
Often brackets [] are used in Excel for functions. To circumvent the problem replace the special characters. Curly braces {} instead of brackets can be used.
Operating System and Release Information
| SAS System | SAS/ACCESS Interface to PC Files | Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M2 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M2 | |
| Microsoft® Windows® for x64 | 9.2 TS2M2 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M2 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M2 | |
| Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M2 | |
| Microsoft Windows Server 2008 | 9.2 TS2M2 | |
| Microsoft Windows XP Professional | 9.2 TS2M2 | |
| Windows 7 Enterprise 32 bit | 9.2 TS2M2 | |
| Windows 7 Home Premium 32 bit | 9.2 TS2M2 | |
| Windows 7 Professional 32 bit | 9.2 TS2M2 | |
| Windows 7 Ultimate 32 bit | 9.2 TS2M2 | |
| Windows Vista | 9.2 TS2M2 | |
*
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.
When using Brackets [] as characters in labels, you can generate "Syntax error in field definitition" error.
| Date Modified: | 2010-12-21 12:58:28 |
| Date Created: | 2010-09-20 12:14:52 |