Data conversion with channels

Applications that use channels to exchange data use a simple data conversion model. Frequently, no conversion is required and, when it is, a single programming instruction can be used to tell CICS® to handle it automatically.

Note the following:
  • Usually, when a (non-Java) CICS TS program calls another (non-Java) CICS TS program, no data conversion is required, because both programs use EBCDIC encoding. For example, if a CICS TS C-language program calls a CICS TS COBOL program, passing it some containers holding character data, the only reason for using data conversion would be the unusual one of wanting to change the CCSID of the data.
  • The data conversion model used by channel applications is simple. The data in channel containers is converted under the control of the application programmer, by using API commands.
  • The application programmer is responsible only for the conversion of user data; that is, the data in containers created by the application programs. System data is converted automatically by CICS , where necessary.
  • The application programmer is concerned only with the conversion of character data. The conversion of binary data (between big-endian and little-endian) is not supported.
  • Your applications can use the container API as a simple means of converting character data from one code page to another.
For data conversion purposes, CICS recognizes two types of data:
CHAR
Character data; that is, a text string. The data in the container is converted (if necessary) to the code page of the application that retrieves it. If the application that retrieves the data is a client on an ASCII-based system, this will be an ASCII code page. If it is a CICS Transaction Server for z/OS® application, it will be an EBCDIC code page.

All the data in a container is converted as if it was a single character string. For single-byte character set (SBCS) code pages, a structure consisting of several character fields is equivalent to a single-byte character string. However, for double-byte character set (DBCS) code pages, this is not the case. If you use DBCS code pages, to ensure that data conversion works correctly you must put each character string into a separate container.

BIT
All non-character data; that is, everything that is not designated as being of type CHAR. The data in the container cannot be converted. This is the default value.
There are two ways to specify the code page for data conversion of the data in a container:
  • As a Coded Character Set Identifier, or CCSID. A CCSID is a decimal number that identifies a specific code page. For example, the CCSID for the ASCII character set ISO 8859-1 is 819.
  • As an IANA-registered charset name for the code page. This is an alphanumeric name that can be specified in charset= values in HTTP headers. For example, the IANA charset names supported by CICS for ISO 8859-1 are iso-8859-1 and iso_8859-1.
If the application programmer does not specify a code page for data conversion, CICS uses the default code page for the whole of the local CICS region, which is specified on the LOCALCCSID system initialization parameter.
You can use the following API commands for data conversion:
  • EXEC CICS PUT CONTAINER [CHANNEL] [DATATYPE] [FROMCCSID
    | FROMCODEPAGE]
  • EXEC CICS GET CONTAINER [CHANNEL] [INTOCCSID |
    INTOCODEPAGE]
For non-Language Environment (LE) AMODE(64) assembler language application programs, you can also use the following API commands for data conversion for data in 64-bit storage:
  • EXEC CICS PUT64 CONTAINER [CHANNEL] [DATATYPE]
    [FROMCCSID | FROMCODEPAGE]
  • EXEC CICS GET64 CONTAINER [CHANNEL] [INTOCCSID |
    INTOCODEPAGE]