About importing copybook definitions using the DECODE command
The DECODE command uses the following DD statements when the value of the IMPORT keyword is Y, that is, IMPORT(Y).
IXPC1 | DD (required) | These are the COBOL and/or PL/I copybook libraries to use. |
IXPFD | DD (optional) | This is the Fileaid for the IMS XREF dataset, which, if present, will be used to map copybook names to various DBD segments. |
XREFCTL | DD (optional) | These are the control statements to map copybook names to the DBD segments or DBD names to xref member names explicitly. |
The following scenarios are possible:
- Default behavior (Neither IXPFD nor XREFCTL DDs are present)
The utility will attempt to find copybook names matching each segment name. If a copybook member is found with the same name as the segment, it will be used to generate FIELDs in that segment. Any existing FIELDs already in the DBD will remain intact.
- Using Fileaid XREF members (IXPFD DD present with no XREFCTL DD)
The utility will attempt to find an XREF member in IXPFD with the same name as a DBD. If such a member is found, the copybooks to use for each segment will be taken from the XREF member.
- Using explicit mapping only. (XREFCTL DD present with no IXPFD DD)
Control statements in the XREFCTL DD will be used to state exactly which copybook to use for any DBD,SEGMENT pair. These control statements are column independent.
The MAP control card command is used for specifying the copybook to be used as follows:
MAP dbdname segname copybookname
or
MAP dbdname segname copybookname 01-level-name
You must use the control card command MAP to specify that a DBD segment should import a given copybook name. In the example of the control statement above:
- dbdname - The name of the DBD that contains the segment of interest.
- segname - The name of the segment to map to a copybook.
- copybookname - The name of the copybook to use for this DBD segment.
- 01-level-name - (optional) The name of a top-level qualifier within the copybook to use in order to limit the fields to a specific block in the copybook. If this is not specified, the entire copybook will be used.
MAP MYDBD MYSEG1 SEG1CPY
MAP MYDBD MYSEG2 SEG2CPY
MAP MYDBD MYSEG3 SEG3CPY
- Using xref and explicit mapping. (Both XREFCTL DD and IXPFD DD present)
It is possible to include information for multiple DBD XREFs in one Fileaid XREF member. To indicate which IXPFD member to use for a given DBD, an XREF command must be used in the XREFCTL statements.
The XREF command is column independent and is used as follows::
XREF dbdname xrefname
In the example of the XREF command above:
- XREF - The command indicating this is a DBD to XREF member mapping statement.
- dbdname - The name of the DBD to map.
- xrefname - The name of the XREF member (in IXPFD DD) to use for this DBD.
The following example shows some DBDs with their own XREF and some that belong to the same XREF member.
XREF MYDBD1 MYXREF1
XREF MYDBD2 MYXREF2
XREF SMALLDB1 BIGXREF
XREF SMALLDB2 BIGXREF
XREF SMALLDB3 BIGXREF