SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 67780: Writing rows to Google BigQuery tables might result in the message "ERROR: During insert: String data, right-truncated..."

DetailsHotfixAboutRate It

Inserting data through SAS/ACCESS® Interface to Google BigQuery might result in no data being inserted and an error message. This issue can occur under the following circumstances:

  • You use both the SCAN_STRINGS=YES option and the MAX_CHAR_LEN= LIBNAME statement option.
  • The MAX_CHAR_LEN= option is set to a number that is smaller than the length of character data to be inserted.
  • The source table is in a SAS® library or in a library on a database engine that is not Google Cloud BigQuery.
  • The target table is in Google Cloud BigQuery.

Here is an example of the error in the SAS log, as well as the syntax that causes the error:

1      LIBNAME BQ BIGQUERY connection-and-authentication-options SCAN_STRINGS=YES MAX_CHAR_LEN=1 ;
NOTE: Libref BQ was successfully assigned as follows:
      Engine:        BIGQUERY
      Physical Name: xxx
2      DATA BQ.target_table ;
3         SET SASHELP.CLASS ; 
4      RUN ;
NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
ERROR: During insert: String data, right-truncated : String data, right-truncated : String data, right-truncated
NOTE: The data set BQ.target_table has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           4.93 seconds
      cpu time            0.04 seconds 

Click the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS/ACCESS Interface to Google BigQueryLinux for x649.41V.04.009.4 TS1M6Viya
* 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.