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).