How Db2 for z/OS uses Unicode

Even if you do not use the Unicode encoding scheme for your data, you should be aware that Db2 uses Unicode in many of its internal processes. This use might affect your applications, queries, storage, and performance.

Db2 uses Unicode in the following ways:

Application preparation and processing:

  • DBRMs that are produced in supported Db2 releases are stored in Unicode UTF-8.
  • Db2 parses DBRMs in Unicode UTF-8, regardless of the original Db2 release that produced the DBRM.
  • Db2 converts application source code to Unicode UTF-8 before it is processed by the precompiler. The precompiler then parses the source code in UTF-8. SQL statements and literals are considered part of the application source and are also parsed in UTF-8. SQL statement text is converted to UTF-8 if it is not already in UTF-8.

Db2 objects and data:

  • Most Db2 catalog data is encoded in UTF-8. (The data in string columns that are not FOR BIT DATA columns in Unicode tables in the catalog is in UTF-8.) When you query the catalog, be aware that many string columns are VARCHAR(128). This data type and length enable you to easily port applications that run on other operating systems.
  • The names of plans and packages are stored in Unicode UTF-8.
  • The values of some special registers are stored in Unicode UTF-8.
  • All EXPLAIN table data is encoded in Unicode UTF-8.
  • SYSIBM.SYSDUMMYU is encoded in Unicode UTF-8. For more information about the SYSIBM.SYSDUMMYx tables, see SYSDUMMYx tables.

Authorization:

  • Db2 authorization processes work on Unicode data. When using certain external authorization processes, such as RACF®, Db2 needs to convert the data to EBCDIC.

Traces:

  • You can specify that Db2 return trace data in Unicode.

SQL statement processing:

  • If you join Unicode and non-Unicode tables, Db2 performs some operations in Unicode. For example, if you compare columns from a Unicode table and an EBCDIC table, Db2 performs the comparison in Unicode.

Utility control statements:

  • Utilities can process control statements that are written in Unicode UTF-8.

DRDA:

  • Remote client systems can send and receive DRDA command and reply messages with character type data in Unicode (UTF-8).