Character fields
The following are available when working with Character fields in the File Field Layout page.
*CHAR
This represents a normal character field and is valid with all File Types.
If you specified a QSYS.LIB externally described file and auto-define detected it, the program retrieves and stores the CCSID of each character field.
With manually defined fields in QSYS.LIB files, CCSID(65535) is assumed.
With stream files and documents, the CCSID of the file is used.
*VARY
A QSYS.LIB variable length character field, which comprises 2 bytes containing the current length followed by character data of that length followed by unused space up to the maximum length.
This type is valid with *FIXED format files only.
Variable length character fields in CSV should use the *CHAR type.
*DBCS
A QSYS.LIB double byte character set graphic field.
This type is valid with *FIXED format only. If you specified a QSYS.LIB externally described file and auto-define detected it, the program retrieves and stores the CCSID of each DBCS field. With manually defined fields, CCSID(13488) is assumed (UCS2).
*DBCSV
As *DBCS but with variable length.
Notes
When read by Log File Monitor, the values are converted to single byte character set fields in CCSID(37). IBM i performs a “best fit” conversion if there isn’t an exact match when converting from one single byte CCSID to another. However, best fit conversion is not done when converting from multi-byte CCSID to single byte CCSID. Instead, if there isn’t an exact match, the substitute character (reverse image block) is used.
The Halcyon translate function does very limited, best-fit conversion itself for UTF-8 to Ebcdic conversion. The following characters are currently handed:
UTF-8 character | Best fit ebcdic 37 character |
E28098 – Opening single quote | 27 – Vertical single quote |
E28099 - Closing single quote | 27 – Vertical single quote |
E2809C - Opening double quote | 22 – Vertical double quote |
E2809D - Closing double quote | 22 – Vertical double quote |