This section describes in more detail how data conversion works in a CICS® on System/390® system.
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:
- Your own, customized, version of DFHUCNV, or
- 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.
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:
- From ASCII to EBCDIC, on receipt of a request from CICS Transaction Server for Windows or CICS on Open Systems,
before invoking the EXEC interface
- From EBCDIC to ASCII, on return from the EXEC interface, before transmitting
the response to CICS Transaction Server for Windows or CICS on Open Systems.
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:
- From
little-endian to big-endian format
, on receipt
of a request from CICS Transaction Server for Windows.
- From
big-endian to little-endian format
, before transmitting
the response to CICS Transaction Server for Windows.
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).
Consider a single resource, a file for example, that requires data conversion.
There are three possibilities; you can use:
- CICS-only conversion--all data fields are handled by the standard CICS conversion program, DFHCCNV
- User/CICS conversion--a combination of nonstandard and standard conversion,
in which some data fields are handled by user code in DFHUCNV and some by
DFHCCNV
- User-only conversion--all data fields are handled by DFHUCNV.
CICS-only conversion
The resource contains no data fields that require nonstandard conversion;
all can be converted by standard means. You must:
- Create a conversion template, using the DFHCNV macros described in Defining the conversion table. This enables DFHCCNV to handle the resource.
- Specify USREXIT=NO on the DFHCNV TYPE=ENTRY macro that defines the resource.
This prevents DFHUCNV from being called unnecessarily.
- 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:
- Create a conversion template.
- 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.
- 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.
- 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:
- Create a conversion template.
- 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.
- 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'.
- 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
- 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.
- Supply a user-written version of DFHUCNV to handle all fields.
This method is not recommended, because:
- The parameter list passed to your DFHUCNV program does not contain as
much information as it does if you define a conversion template. The fields
that contain data are listed in Parameter list (DFHUVNDS).
- It relies on the following:
- That all workstations connected to the CICS on System/390 server share a common
encoding (for example, 437) for character data, and a common format (for example,
little-endian
) for binary data
- That your version of DFHUCNV knows the ASCII encoding and binary format,
and knows the corresponding EBCDIC encoding
- That DFHUCNV provides the appropriate ASCII/EBCDIC translation tables.
The sequence of conversion processing is as follows:
- 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:
- 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.
- DFHUCNV must be present in your system unless all DFHCNV TYPE=ENTRY macros specify USREXIT=NO.
- 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.
- 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.
- 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.
[[ Contents Previous Page | Next Page Index ]]