Db2 considerations

The codepage of Db2® host variables is governed by various factors such as CODEPAGE, SQLCCSID, and DSNHDECP file. However, for host variables declared as UTF-8, these are overridden and the Db2 coprocessor assumes that the item has a CCSID of 1208.

Only UTF-8 data items declared with the BYTE-LENGTH phrase of the PICTURE clause can be used as Db2 host variables. In this case, when the host variable corresponds to a CHAR column in a Db2 table, the byte length of the CHAR column and the number of bytes specified in the BYTE-LENGTH phrase of the PICTURE clause should match to avoid unexpected truncation or padding of data.

Note: The Db2 precompiler cannot be used with a COBOL program containing UTF-8 data items.