The SYSTEM.SYSSTRINGS catalog table contains information on all the CCSID conversions that this product supports. For each CCSID conversion performed, there must be a corresponding row in this table.
To insert a row, follow these steps:
The conversion type is based on the encoding scheme (EBCDIC or ASCII) of the CCSIDs and whether they are for tagging SBCS, mixed, or graphic data. Note that in any conversion that this product supports, the target CCSID is always EBCDIC. The following are conversion types recognized:
The error byte is only used for SBCS conversions, and therefore applies to all conversion types except for 'GG'. Be careful what you set it to: if a character in the source gets converted to the error byte, the conversion is terminated and an error occurs. CCSID conversions either have a NULL error byte, or are set as follows for the detection of DBCS characters in the source when they are not allowed:
CDRA SBCS conversion tables are modified for use in this type of conversion, so that all DBCS first bytes get mapped to X'3E' instead of the original X'3F'.
For more information, see step 7, "Customize the SBCS Conversion Table".
As with the error byte, the substitution byte is not applicable in 'GG' type conversions. Whenever a character in the source gets converted to the substitution byte, warning flags are set in the SQLCA. This byte is set based on whether a given conversion table is created using the enforced subset match criterion. (For more on this subject, refer to the Character Data Representation Architecture Level 1, Registry manual.) If it is, then this byte is set to X'3F', which is the CDRA-defined SUB character for conversions with EBCDIC target CCSIDs.
This field only applies in the cases of 'MM', 'PM', and 'GG' type conversions. It contains the name of the DBCS conversion table that is shipped with this product for use in the conversion. If it contains a value other than any of the DBCS conversion table names that the database manager recognizes, then the value is treated as the name of a user-defined DBCS conversion exit. (For information on creating a user-defined TRANSPROC exit, see Coding Your Own TRANSPROC Exit.)
An SBCS conversion table may be required except in the case of the 'GG' conversion type, where it is not applicable. For a conversion type where SBCS conversion applies, it is possible to specify a NULL SBCS conversion table. For example, you can have a mixed-to-mixed conversion where the SBCS CCSIDs of the source and target mixed CCSIDs are the same, in which case you do not need to perform conversion on the SBCS portion(s) of the mixed source data.
If you require a non-NULL SBCS conversion table, check the catalog table SYSTEM.SYSSTRINGS to see whether it is already supported. If it is not currently supported, then you have to create the conversion table based on the conversion mapping that you define.
A user-created SBCS conversion table should be in the same format as those supplied by CDRA: that is, a 256-byte string where the byte at offset n (starting at offset 0) corresponds to what codepoint n in the source CCSID is converted to. You also have to customize the conversion table for use if its source CCSID is ASCII SBCS or ASCII mixed.
If your SBCS conversion table is to be used for a conversion with an ASCII SBCS or ASCII mixed source CCSID, you will have to modify it for the proper detection of DBCS first bytes. This requires that you determine the ranges of valid DBCS first byte codepoints for the ASCII SBCS source CCSID; then set the contents of the SBCS conversion table at the offsets that correspond to the DBCS first byte codepoints to:
This is required for the following conversions, where DBCS characters are not allowed in the ASCII source:
In the case of the CDRA-supplied SBCS conversion tables that are shipped for use in the types of conversion mentioned above, the values contained at the DBCS first byte offsets in the conversion tables have been changed from the original X'3F' to X'3E'. This is also the error byte for these conversions. X'3F' remains the substitution byte for these conversions.
You should also set the DBCS first byte offsets in your conversion table to a unique character, which will also be your error byte.
This is required for 'PM' conversions, where DBCS characters in the ASCII source are allowed and are converted. The database manager considers a byte a DBCS first byte if it gets converted to X'00' using the ASCII-to-EBCDIC SBCS conversion table, and if it is not X'00' itself to begin with.
In the case of the CDRA-supplied SBCS conversion tables that are shipped for use in 'PM' conversions, the values contained at the DBCS first byte offsets in the conversion tables used to be X'3F', and have been changed to X'00'. You must therefore also set the characters at the DBCS first byte offsets in the conversion table to X'00', in order for DBCS characters to be recognized in the mixed source.
You can create a DBSU job to insert the row into SYSTEM.SYSSTRINGS. For examples, review the ARITPOP MACRO which is supplied with the DB2 Server for VM code. This macro inserts a row into SYSTEM.SYSSTRINGS for every supported conversion between CCSIDs that are supplied with the database manager.