If your program handles record data (data formatted into fields), you have to take care of the following things:
Note that data length may be changed because of insertion or removal of SO/SI when converting the code between PC and host. In order to avoid an overflow of data, your program should consider the possibility of an increase or decrease of the data length.
(Example) field length = 12 bytes in both Host and PC environment PC field Host field ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │p│p│p│P 1│P 2│P 3│p│p│p│───>│h│h│h│<│H 1│H 2│H 3│>│h│ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘ note: last 2 bytes 'hh' is truncated after code translation. where h, Hn, p, and Pn denote SBCS-host code, DBCS-host code, SBCS-PC code, and DBCS-PC code respectively. < and > denote SO and SI respectively.
Note that several host products support the DBCS field, which only contains the DBCS characters without SO/SI. For example, IXF format supports the the DBCS field. The following example depicts the differences of handling SO/SI between the DBCS field and the CHAR field.
Host side format: ┌─────────┬────────────┬─────────────┬───────┐ │ Numeric │ DBCS │ CHAR │... │ ├─────────┼────────────┼─────────────┼───────┤ │ 12345│H1H2H3H4H5H6│hhh<H1H2H3>hh│... │ └─────────┴────────────┴─────────────┴───────┘ │ PC side format: ┌─────────┬────────────┬─────────────┬───────┐ │ Numeric │ DBCS │ CHAR │ ... │ ├─────────┼────────────┼─────────────┼───────┤ │ 12345│P1P2P3P4P5P6│pppP1P2P3ppnn│ ... │ └─────────┴────────────┴─────────────┴───────┘ where n denotes an SBCS space, null or the like, which indicates the end of significant