A Straight Replication script requires DESCRIPTIONS for each Source and Target DATASTORE as well as either a straight mapping procedure for each Source/Target pair or use of the REPLICATE Command as shown in the sample script below. In the sample script, a CDCzLog type Publisher uses TCP/IP to publish and transport data to the target Apply Engine. The Main Select section contains only references to the Source and Target Datastore aliases and the REPLICATE Command. Individual mapping procedures are not required in this case.
The sample script, IMSTOIMS, is listed below. See the Engine Reference for more details regarding the use of the REPLICATE Command and for a full explanation of the capabilities provided by Engine scripts.
Note: IMS Straight Replication is unique in that only the source IMS Database Description (DBD) and a single REPLICATE Command is required, not the Segment level COBOL Descriptions.
- The DATASTORE specification has a number of parameters. Two in particular are unique to IMS and more specifically IMS replication.
- ACCEPT ALL instructs the Engine to accept all segments without any corresponding record layout DESCRIPTION specifications. Normally the Engine requires such a specification for every record passed to the engine.
- While no DESCRIPTION specifications are required for Segments in a Straight Replication script, the DBD's for the IMS databases whose are segments captured is required in order to determine both child and parent keys.
- Engine scripts that need access to individual elements of a segment will require the physical segment description and Connect CDC (SQData) has been designed to reuse existing copy books containing the COBOL descriptions of the data.
-------------------------------------------------------------
-- IMS REPLICATION SCRIPT FOR ENGINE: IMSTOIMS
-------------------------------------------------------------
-- SUBSTITUTION VARS USED IN THIS SCRIPT:
-- %(ENGINE) - ENGINE / REPORT DD NAME
-- %(HOST) - HOST OF Capture
-- %(PORT) - TCP/IP PORT of SQDAEMON
-- %(PUBNM) - Publisher agent alias in sqdagents.cfg
-------------------------------------------------------------
-- CHANGE LOG:
-- 2018/01/01: INITIAL RELEASE
-------------------------------------------------------------
JOBNAME %(ENGINE);
OPTIONS CDCOP('I','U','D');
-------------------------------------------------------------
-- DATA DEFINITION SECTION
-------------------------------------------------------------
---------------------------
-- Source Data Descriptions
---------------------------
BEGIN GROUP IMS_DBD;
DESCRIPTION IMSDBD DD:IMSDBD(<DBDNAME1>) AS <DBDNAME1>;
DESCRIPTION IMSDBD DD:IMSDBD(<DBDNAME2>) AS <DBDNAME2>;
END GROUP
;
------------------------------
-- Source Segment Descriptions
------------------------------
-- None required for Straight Replication
------------------------------
-- Target Segment Descriptions
------------------------------
-- None required for Straight Replication
---------------------------
-- Source Datastore(s)
---------------------------
DATASTORE cdc://%(HOST):%(PORT)/%(AGNT)/%(ENGINE)
OF IMSCDC
AS CDCIN
ACCEPT ALL
DESCRIBED BY GROUP IMS_DBD
;
---------------------------
-- Target Datastore(s)
---------------------------
DATASTORE *
OF IMSDB
AS TARGET
DESCRIBED BY GROUP IMS_DBD
;
---------------------------
-- Variables
---------------------------
-- None required for Straight Replication
---------------------------
-- Procedure Section
---------------------------
-- None required for Straight Replication
-------------------------------------------------
-- Main Section - Script Execution Entry Point
-------------------------------------------------
PROCESS INTO TARGET
SELECT
{
-- OUTMSG(0,IMSSEGNAME(CDCIN)
-- ,' CDCTSTMP=',CDCTSTMP(CDCIN)
-- ,' CDCOP= ',CDCOP(CDCIN)
-- ,' CDCSTCK= ',CDCSTCK(CDCIN)
-- ,' CDCUOW=',CDCUOW(CDCIN))
REPLICATE(TARGET)
}
FROM CDCIN;