Customizing Character Data by Overriding the CCSID Setting

In certain conditions, when replicating with IBM Db2, you might want to customize the current codepage (CCSID) default values during read operations with user-defined character mapping or override an existing character with a different one. For example, you could have a Db2 table where there are null string values and you want them show up as blank characters in your application.

Syniti Data Replication locates and reads the CCSID configuration file ccsid_properties.xml in the CodePages directory.

To implement customized character data, create your own .ovr file for a specific CCSID with the the mapping overrides, then edit the ccsid_properties.xml to add the mapping. (Note that the Override CCSID connection property has been deprecated and that the way to override codepage conversion is now by the use of the xml file. In Syniti DR V 9.7.1 and above, values from the Override CCSID field are placed in Extended Properties, but have no effect. Please delete the property value and create the override using the method described below.)

The sample ccsid_properties.xml file below contains common scenarios:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ccsid_properties xmlns="http://www.hitsw.com">
<property ccsid="1114" mapToCcsid="950"/>
<property ccsid="1252" mappingFileName="1252.bin"/>
<property ccsid="933" type="MULTI" mappingFileName="933.bin" overrideFileName="933.ovr"/>
<property ccsid="951" type="MULTI NO SHIFT" derivedFromCcsid="950" overrideFileName="951.ovr" />
</ccsid_properties>

<property ccsid="1114" mapToCcsid="950"/>
Maps 1114 to 950, i.e. whenever 1114 is referenced, CodePage will substitute it with 950.

<property ccsid="1252" mappingFileName="1252.bin"/>
Tells CodePage to use the specified mapping file 1252.bin for 1252

<property ccsid="933" type="MULTI" mappingFileName="933.bin" overrideFileName="933.ovr"/>
Tells CodePage to use 933.bin and 933.ovr, type is used to specify the type of table (MULTI means not single)

<property ccsid="951" type="MULTI NO SHIFT" derivedFromCcsid="950" overrideFileName="951.ovr" />
Creates a new CCSID derived from an existing CCSID (uses the mapping of an existing CCSID) and then applies overrides to it. Note that the type here is MULTI NO SHIFT - the 950 conversion does not use shift in and shift out.

NOTE: If type is not specified, CodePage will try to figure it out using an internal list.

Override files have an .ovr extension and need to be copied into the same directory as the ccsid_properties.xml file: CodePages.

The .ovr file is a text file that contains mapping overrides.

Example file content:

! comment - commenting lines starts with !
! each mapping has 3 tokens: <native value> <operator> <unicode value>
! 1) the operator = or , means 2-way native to unicode to native mapping
! 2) the operator > means 1-way native to unicode mapping
! 3) the operator < means 1-way unicode to native mapping (unicode is always on the right hand side)

Example CCSID Overrides:

05 = 5A (equivalent to 05 , 5A)
A7 > 100A
2A00 < 128A