IBM Support

Linux ODBC driver throws CWB0111 warning on variant characters

Troubleshooting


Problem

Getting CWB0111 warning message when Linux LANG environment variable is set to UTF-8

Resolving The Problem


When selecting character data from the IBM i where a CHAR field has an EBCDIC CCSID and the character(s) are not part of the invariant character set some Linux client environments may cause the IBM i Access for Linux ODBC driver to throw warning messages:

DIAG [22018] [IBM][System i Access ODBC Driver]Column 3: CWB0111 - A buffer passed to a system call is too small to hold return data
DIAG [01004] [IBM][System i Access ODBC Driver]String data right truncation.

The problem is dependent on the Linux client environment.

In a failing case the client has UTF-8 Unicode code page 1208 set and in a working case, the client uses ISO ASCII code page 819 :

The following will be seen in the cwbtrc output:

Failing case:
\B\1.1.0.9-1.0\cwbdetail64-AppName-4a5f.csv
8960;10005;NL GetANSICodePage cp=1208
08960;10008;pc codepage: 1208  server's job CCSID: 278

Working case:
\A\1.1.0.2-1.0\cwbdetail64-AppName-15d7.csv
4560;10005;NL GetANSICodePage cp=819
34560;10008;pc codepage: 819  server's job CCSID: 278

To resolve, add the "CCSID" keyword to the DSN in your odbc.ini  . For example:
[DSNname]
Description          = IBM i Access ODBC Driver 64-bit
Driver               = /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup                = /opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
System               = IBMiSystemName
UserID               =
Password             = *********
Naming               = 0
DefaultLibraries     = QGPL
Database             =
ConnectionType       = 0
CommitMode           = 2
ExtendedDynamic      = 1
DefaultPkgLibrary    = QGPL
DefaultPackage       = A/DEFAULT(IBM),2,0,1,0,512
AllowDataCompression = 1
LibraryView          = 0
AllowUnsupportedChar = 0
ForceTranslation     = 0
CCSID                = 819
Trace                = 1

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Access for Linux","Platform":[{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
18 December 2019

UID

nas8N1022560