EGL Reference Guide for iSeries

Conversion algorithm

Data conversion of records and structures is based on the declarations of the structure items that lack a substructure.

Data of type CHAR, DBCHAR, or MBCHAR is converted in accordance with the COBOL or Java conversion tables (for conversion that occurs in an EGL-generated invoker).

No conversion is performed for filler data items (data items that have no name) or for data items of type DECIMAL, PACF, HEX, or UNICODE.

On EBCDIC-to-ASCII conversion for MBCHAR data, the conversion routine deletes shift-out/shift-in (SO/SI) characters and inserts an equivalent number of blanks at the end of the data item. On ASCII-to-EBCDIC conversion, the conversion routine inserts SO/SI characters around double-byte strings and truncates the value at the last valid character that can fit in the field. If the MBCHAR field is in a variable length record and the current record end is in the MBCHAR field, the record length is adjusted to reflect the insertion or deletion of SO/SI characters. The record length indicates where the current record ends.

For data items of type BIN, the conversion routine reverses the byte order of the item if the caller or called platform uses Intel binary format and the other platform does not.

For data items of type NUM or NUMC items, the conversion routine converts all but the last byte using the CHAR algorithm. The sign half-byte (the first half byte of the last byte in the field) is converted according to the hexadecimal values shown in the next table.


EBCDIC for type NUM EBCDIC for type NUMC ASCII
F (positive sign) C 3
D (negative sign) D 7


Related reference
Association elements
bidiConversionTable
Bidirectional language text
callLink element
clientCodeSet


serverCodeSet
sysLib.convert
sysVar.callConversionTable


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]