The conversion process

This section describes in more detail how data conversion works in a CICS® on System/390® system.

Components

The CICS or user-supplied mirror transactions do the System/390 conversions, using the following CICS components:

DFHCNV
The conversion table. For each resource for which conversion is required, DFHCNV contains a conversion template. A conversion template is a table entry defining fields in a data area that are to be converted, and the conversion method to be applied to each field.

You define the DFHCNV table with the DFHCNV resource definition macros described in Defining the conversion table.

DFHCCNV
The CICS program that drives the conversion process. DFHCCNV uses the DFHCNV table to determine the required conversions. It applies standard conversion to those fields in the conversion templates for which nonstandard, user-handled conversion is not specified.
The user-replaceable conversion program, DFHUCNV
A user-replaceable program that allows you to override the standard conversions applied by CICS. You can use it to apply your own conversion logic to specific data fields. (How to do this is described in User/CICS conversion.)

You can use the supplied program as a model on which to base your own version.

For all CICS on System/390 products other than CICS TS for z/OS®, Version 2.2 and later, to take advantage of nonstandard conversion you must provide a single data conversion program named DFHUCNV. This will probably be a customized version of the DFHUCNV program supplied with CICS.

For CICS TS for z/OS, Version 2.2 and later, you can provide either:

  1. Your own, customized, version of DFHUCNV, or
  2. One or more differently-named conversion programs
In the following sections, the generic term "DFHUCNV" represents both the (possibly customized) IBM-supplied conversion program and user-named conversion programs

.

Process

This section describes the standard conversions that can be applied by DFHCCNV to specific fields in a conversion template. Other types of conversion are possible, if you write a DFHUCNV program.

Character data
Character data can be converted:

The translation tables shipped with CICS conform to the standards described in the IBM® Character Data Representation Architecture Level 2 - Registry, SC09-1391.

Binary data
Binary data can be converted:

In CICS Transaction Server for Windows, COBOL/2 programs can be compiled so that binary and packed decimal fields are in System/390-compatible format and require no conversion at the System/390 (see the DATATYP option of the DFHCNV TYPE=FIELD macro).

Standard and nonstandard conversion

Consider a single resource, a file for example, that requires data conversion. There are three possibilities; you can use:

CICS-only conversion

The resource contains no data fields that require nonstandard conversion; all can be converted by standard means. You must:

  1. Create a conversion template, using the DFHCNV macros described in Defining the conversion table. This enables DFHCCNV to handle the resource.
  2. Specify USREXIT=NO on the DFHCNV TYPE=ENTRY macro that defines the resource. This prevents DFHUCNV from being called unnecessarily.
  3. Do not specify DATATYP=USERDATA on any of the DFHCNV TYPE=FIELD macros that define the data fields.

User/CICS conversion

The resource contains some fields that can be converted by standard means, and some that require nonstandard conversion. You must:

  1. Create a conversion template.
  2. Specify USREXIT=YES or (for CICS TS for z/OS Version 2.2 and later) USREXIT=program on the DFHCNV TYPE=ENTRY macro that defines the resource. If USREXIT=YES is specified, DFHUCNV is called. If USREXIT=program is specified, your conversion program named program is called.
  3. Specify DATATYP=USERDATA on the DFHCNV TYPE=FIELD macros that define the nonstandard data fields. Optionally, also define nonstandard fields with a USRTYPE value in the range X'50' through X'80' (see the USRTYPE option of the DFHCNV TYPE=FIELD macro). These values are passed to your user program, and can be used to distinguish between different types of nonstandard field.

    Define standard fields as DATATYP=CHARACTER, PD, BINARY, GRAPHIC, or NUMERIC, as appropriate.

  4. Supply a user-written version of DFHUCNV or (for CICS TS for z/OS Version 2.2 and later) a differently-named conversion program to handle the nonstandard fields.

    The user-replaceable conversion program gives a description and listing of DFHUCNV, with guidance on how to use it as a basis for your own conversion program. (The default version supplied with CICS handles only temporary storage requests for which templates have been defined.)

User-only conversion

The resource contains no fields that can be converted by standard means; all require nonstandard conversion. There are two methods of enabling user-only conversion.

Method 1

This is the recommended method:

  1. Create a conversion template.
  2. Specify USREXIT=YES or (for CICS TS for z/OS Version 2.2 and later) USREXIT=program on the DFHCNV TYPE=ENTRY macro that defines the resource. If USREXIT=YES is specified, DFHUCNV is called. If USREXIT=program is specified, your conversion program named program is called.
  3. Specify DATATYP=USERDATA on all the DFHCNV TYPE=FIELD macros that define the data fields. Optionally, define all fields with a USRTYPE value in the range X'50' through X'80'.
  4. Supply a user-written version of DFHUCNV or (for CICS TS for z/OS Version 2.2 and later) a differently-named conversion program to handle all fields.
Method 2

  1. Do not create a conversion template. If there is no template for a resource, CICS invokes DFHUCNV (but not DFHCCNV), on the assumption that it is to handle all conversion.
  2. Supply a user-written version of DFHUCNV to handle all fields.

This method is not recommended, because:

Sequence of conversion processing

The sequence of conversion processing is as follows:

  1. Unless USREXIT=NO is specified in the DFHCNV TYPE=ENTRY macro that defines the conversion template for the resource, DFHCCNV links to DFHUCNV, passing the parameter list described in Parameter list (DFHUVNDS).
    Notes:
    1. If you have not defined a template, DFHUCNV is invoked, on the assumption that the user program is to handle all conversions for the resource.
    2. DFHUCNV must be present in your system unless all DFHCNV TYPE=ENTRY macros specify USREXIT=NO.
  2. If a conversion template is defined for the resource, DFHUCNV is responsible for converting any fields with a type in the user-data range.

    If no conversion template is defined for the resource, DFHUCNV is responsible for determining the format of the data, and for converting all appropriate fields.

  3. On return from DFHUCNV, DFHCCNV carries out any standard conversions specified in the conversion template for fields that are not subject to user-defined conversion.
  4. The shipped request is executed.

If data conversion is required, a DPL request from CICS Transaction Server for Windows should not use the TRANSID option to specify a transaction other than the default CPMI, which is required to trigger conversion.

Figure 12 summarizes System/390 conversion procedures.

Figure 12. Data conversion in CICS on System/390
The picture is a flow diagram that shows the sequence of data conversion processing in CICS on System/390. It shows, in diagrammatic form, the four steps in the list above.

Related concepts
Where data conversion takes place
Function shipping and DPL
Distributed transaction processing
Transaction routing
Types of conversion
Character data
Binary data
The conversion process
User-defined conversion tables
Example macros
The user-replaceable conversion program
Related tasks
Avoiding data conversion
Resource definition to enable data conversion
Defining the conversion table
Assembling and link-editing the conversion programs
Related reference
Where data conversion takes place
Character data
Defining the conversion table
The user-replaceable conversion program

Related concepts
Where data conversion takes place
Function shipping and DPL
Distributed transaction processing
Transaction routing
Types of conversion
Character data
Binary data
User-defined conversion tables
Example macros
The user-replaceable conversion program
Related tasks
Avoiding data conversion
Resource definition to enable data conversion
Defining the conversion table
Assembling and link-editing the conversion programs
Related reference
Where data conversion takes place
Character data
Defining the conversion table
The user-replaceable conversion program
[[ Contents Previous Page | Next Page Index ]]