When the LIBNAME statement contains *_max_bytes with DB2 UTF-8 encoding and SAS Unicode, errors occur when you insert into DB2. Here are two scenarios in which this issue occurs.
Scenario 1:
Read from a DB2 table that contains a VARGRAPHIC and create a SAS data set. Then create a DB2 table from the SAS data set, and the following error occurs:
Scenario 2:
Create a DB2 table from sashelp.class (with *_max_bytes set), and the following error occurs:
To work around this issue, create one LIBNAME statement for reading from DB2 and one LIBNAME statement to write to DB2.