33 users online | 33 Guests and 0 Registered

How can I avoid the message: "WARNING: The quoted string currently being processed has become more than 262 characters long. You may have unbalanced quotation marks."?


The maximum length of a character string in the Language of SAS is 32,767 characters, however when issuing an instruction containing a long quoted string the WARNING message may appear in the LOG. The following statement uses the ODBC Driver to assign an Excel Workbook as a data library in a long string literal:

libname myxl odbc noprompt = 'Driver           = Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb) ;
                              Threads          = 3 ;
                              ReadOnly         = 1 ;
                              PageTimeout      = 5 ;
                              MaxScanRows      = 8 ;
                              MaxBufferSize    = 2048 ;
                              Fil             = excel 12.0 ;
                              DefaultDir       = C:\ ;
                              DBQ              = C:\Results\Report.xls' ;

The LOG includes the WARNING message, however the instruction is completed successfully:

1    libname myxl odbc noprompt = 'Driver           = Microsoft Excel Driver (*.xls, *.xlsx,
1  ! *.xlsm, *.xlsb) ;
2                                  Threads          = 3 ;
3                                  ReadOnly         = 1 ;
4                                  PageTimeout      = 5 ;
5                                  MaxScanRows      = 8 ;
WARNING: The quoted string currently being processed has become more than 262 characters long.
         You may have unbalanced quotation marks.
6                                  MaxBufferSize    = 2048 ;
7                                  Fil             = excel 12.0 ;
8                                  DefaultDir       = C:\ ;
9                                  DBQ              = C:\Results\Report.xls' ;

It is generally bad practice to have WARNING messages in your LOG and code should be amended to eliminate these. In this instancehowever the code is not at fault.

Since Version 9, there is a Global System Option options noquotelenmax ; which will suppress the WARNING message:

1    options noquotelenmax ;
2
3    libname myxl odbc noprompt = 'Driver           = Microsoft Excel Driver (*.xls, *.xlsx,
3  ! *.xlsm, *.xlsb) ;
4                                  Threads          = 3 ;
5                                  ReadOnly         = 1 ;
6                                  PageTimeout      = 5 ;
7                                  MaxScanRows      = 8 ;
8                                  MaxBufferSize    = 2048 ;
9                                  Fil             = excel 12.0 ;
10                                 DefaultDir       = C:\ ;
11                                 DBQ              = C:\Results\Report.xls' ;
Author:
Alan D Rudland
Revision:
1.1
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags