Common encoding conversion scenarios
Use the following scenarios as guidelines when you want to convert character set encodings between your source and target.
Scenario 1: Converting encoding between a DB2 z/OS source and a DB2® LUW target
In this scenario, you have a DB2® z/OS® source database with data in Simplified Chinese and a default database character set encoding of CCSID 935. Your target database is a DB2 for Windows system with data in Simplified Chinese and a default character set encoding of GB18030 (CCSID 1392).
CDC Replication will automatically detect the default database encoding of the source and target columns in your table mappings. If the detected encodings are appropriate for your business needs, no further configuration is required.
Scenario 2: Converting from a national language character set to Unicode
In this scenario, you have a configuration in which data needs to be converted from a national language character set to Unicode. For example, the character set encoding on the source is Traditional Chinese, while the character set encoding on the target (to which you want to convert) is Unicode. No configuration is required in Management Console.
Scenario 3: Overriding the database default encoding of a column as detected by CDC Replication
The default encoding of a column in a database can be different from the data itself. CDC Replication allows you to deal with these situations by allowing you to override the detected encoding of a column.
For example, you have a source database with a default encoding of Windows-1252 and you want to replicate CHAR data to your target. You also have Shift-JIS character data in CHAR columns in your source database. CDC Replication will likely detect that all CHAR columns in your source database are Windows-1252 because this is the encoding of the column in your database or the default database encoding. CDC Replication will determine if you can select an encoding that is more appropriate for your data. If CDC Replication allows it, you can override the Windows-1252 encoding and select Shift-JIS encoding for those columns that contain Shift-JIS data.
Scenario 4: Replicating mixed character data encodings on the source to multiple encodings on the target
In this scenario, your source data is a mix of different character encodings but is primarily IBM-943. Business requirements dictate that you must have the following character encodings on your target: IBM-943 and IBM-943c.
CDC Replication allows you to override the detected encodings in your target columns and set them to either IBM-943 or IBM-943c.
Scenario 5: Replicating character data with no change to encoding
You can replicate data as is with no change to the encoding by designating the source and target columns in a table mapping as a binary with the Override encoding as binary option in Management Console.
In
this scenario, your DB2 for z/OS source has data structures
in a character field. The data structure contains EBCDIC characters,
dates, and packed numbers. You want to use a user exit to split the
data and send it to 10-20 fields on your target. You can use the Java™ getBytes function in your user
exit to read the data and perform the data conversion. Since the getBytes function
is only allowed on a binary field or a character field that is overridden
in Management Console as
a binary, you can use Override encoding as binary option
for the source and target columns in the table mapping. This will
allow getBytes to retrieve data from the source image as bytes.
The Override encoding as binary option is useful in scenarios where the character column does not contain characters only, but other data types with complex structures.
Scenario 6: Overriding a binary field with an appropriate encoding for your data
In this scenario, you have source column with various encodings in a binary field. You use row filtering when replicating tables to the target so that you only have one type of encoding on the target. In the source columns that are detected as Binary by Management Console, you can override the detected encoding type of Binary and select the encoding that is appropriate for the actual data in each source column. In this scenario, you can have the same source table mapped to the same target table, but the encodings on the source binary columns are different from the single encoding that is found on your target.