User-defined conversion tables

If you specify SRVERCP=USR or USRD in a DFHCNV TYPE=ENTRY macro, you must provide user-defined conversion tables. The standard conversion program (DFHCCNV) uses these tables, and they are made available to the user-replaceable conversion program, DFHUCNV.

Place your user-defined conversion tables in the DFHCNV macro source, anywhere after the DFHCNV TYPE=INITIAL macro. For source readability, the best place is probably after the DFHCNV TYPE=FINAL macro.

The following are descriptions of the types of table you may need to define and the way to label each type.

SRVERCP=USR

You must provide two character conversion tables, labelled ASTOEB and EBTOAS. Each table must be 256 bytes long. ASTOEB is used for ASCII to EBCDIC conversion and EBTOAS is used for EBCDIC to ASCII conversion. The hexadecimal value of a character byte is used as an offset in the conversion table to obtain the converted value of the character. Figure 15 illustrates this process.

SRVERCP=USRD

You must provide DBCS character conversion tables labelled DBASTOEB and DBEBTOAS, in the DFHCNV source. These must be after the DFHCNV TYPE=INITIAL macro, but otherwise anywhere in the source. Each table must be a list of 256 four-byte pointers and 256 pairs of 256-byte translate tables. The first byte of a DBCS character is used as an index to the list of pointers. Using the first byte of the DBCS character as a hexadecimal offset in the list, the pointer found is the address of a pair of 256-byte translate tables. The second byte of the DBCS character is used as an offset in each of the two 256-byte translate tables to obtain the first and second bytes of the converted DBCS character. Figure 16 illustrates this process.

You must also provide an SBCS conversion table as specified under USR above.

Figure 15. Structure of SBCS conversion tables
Structure of SBCS conversion tables

Figure 16. Structure of DEBUTS conversion tables
Structure of DEBUTS conversion tables

Invalid and undefined DBCS characters

In ASCII and EBCDIC, certain code ranges are valid DBCS code. Any double-byte value outside these ranges is an invalid DBCS character. In the supplied conversion tables, invalid DBCS characters convert to X'FFFF', as defined by the code page architecture.

Within the valid code range, several thousand double-byte values are defined as actual DBCS characters. A double-byte value within the valid code range, but not defined as a DBCS character, is an undefined DBCS character.

User-defined tables should follow the above conventions for invalid and undefined characters.

Related concepts
Where data conversion takes place
Function shipping and DPL
Distributed transaction processing
Transaction routing
Types of conversion
Character data
Binary data
The conversion process
Example macros
The user-replaceable conversion program
Related tasks
Avoiding data conversion
Resource definition to enable data conversion
Defining the conversion table
Assembling and link-editing the conversion programs
Related reference
Where data conversion takes place
Character data
Defining the conversion table
The user-replaceable conversion program
[[ Contents Previous Page | Next Page Index ]]