_CODESET

Converts a string between the EBCDIC and ASCII character sets.

Syntax:

call "_CODESET" using  function-code, length, string
                               returning status-code

Parameters:

  Using call prototype (see Key) Picture
function-code pic 9(2) comp-x
length pic 9(9) comp-x
string pic x(n)
status-code See Library Routines - Key

On Entry:

function-code
The type of conversion. Can be one of:
0 Convert EBCDIC to ASCII
1 Convert ASCII to EBCDIC
length
The number of characters in the string to convert.
string
The string to convert.

On Exit:

string
The converted string.
status-code
Indicates success or failure of the conversion.

Comments:

You cannot use this routine in a program that is compiled with a mainframe dialect, because it uses COMP-X data types, which are not supported on the mainframe.