The ToEBCDIC procedure converts characters from one code page to the default EBCDIC code page for the system. The default source code page used is the ASCII 819 CCSID. This allows ASCII to EBCDIC conversion, however the source (input string's) CCSID may be any CCSID thus allowing conversion between different character sets.
varying-char-value ToEBCDIC ( szInputString 65535A Const Varying nCCSID 10I 0 Const Options(*NOPASS) |
If the function succeeds, the return value is the szInputString parameter's data converted to the default CCSID of the job. If the function fails, no value is returned, that is the return value is an empty string, or blanks.
This procedure uses the OS/400 iconv() API to do the conversion using CCSID codes.