Create straight VSAM replication script - connect_cdc_sqdata - Latest

Connect CDC (SQData) Change Data Capture

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (SQData)
Version
Latest
Language
English
Product name
Connect CDC (SQData)
Title
Connect CDC (SQData) Change Data Capture
Copyright
2024
First publish date
2000
Last updated
2024-11-25
Published on
2024-11-25T15:05:48.570404

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, VSMTOVSM, 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:
  • The DATASTORE specification has a number of parameters. Two in particular are unique to VSAM and more specifically VSAM replication:
    • ACCEPT ALL instructs the Engine to accept all records without a corresponding DESCRIPTION for every record processed. VSAM files can be treated as binary data when used with the REPLICATE Command and therefore not require record DESCRIPTIONS.
    • DUMMY is a reserved word that says no DESCRIPTION specification has been provided for the Datastore. Normally Engine scripts require a physical description of target datastores. Connect CDC SQData has been designed to reuse existing data description information that for VSAM would generally consists of COBOL "copy books".
    • APPLID specifies the CICS subsystem where the captured changes will be applied to the target VSAM file.
    • SQDACVSM is the name of the Connect CDC SQData CICS/VSAM apply program, that running under CICS, performs the actual VSAM file maintenance based on captured data processed by the Engine script.
  • SQDV is the CICS transaction name assigned to the SQDACVSM program. If the default transaction, SQDV has been changed to accommodate the environment, all references to the name in Engine scripts must be changed to match.
  • The generic script includes a commented CASE statement that uses the SETTARGET function to specify an alternate target File Name when the replicated file is in the same CICS environment as the original.
  • The Target DATASTORE contains the Keyword "RRS" which applies only to VSAM processing and specifies that IBM's Resource Recovery Manager will manage two phase commits.
 -------------------------------------------------------------
          -- VSAM REPLICATION SCRIPT FOR ENGINE: VSMTOVSM
          -------------------------------------------------------------
          -- SUBSTITUTION VARS USED IN THIS SCRIPT:
          -- %(ENGINE) - ENGINE / REPORT DD NAME
          -- %(HOST) - HOST OF Capture
          -- %(PORT) - TCP/IP PORT of SQDAEMON
          -- %(AGNT) - Capture Agent alias in sqdagents.cfg
          -- %(APPLID) - Target CICS APPLID
          -------------------------------------------------------------
          -- CHANGE LOG:
          -- 2015/09/01: INITIAL RELEASE
          -------------------------------------------------------------
          JOBNAME %(ENGINE);
          OPTIONS CDCOP('I','U','D');
          -------------------------------------------------------------
          -- DATA DEFINITION SECTION
          -------------------------------------------------------------
          ---------------------------
          -- Source File Descriptions
          ---------------------------
          -- None required for Straight Replication
          ---------------------------
          -- Target File Descriptions
          ---------------------------
          -- None required for Straight Replication
          ---------------------------
          -- Source Datastore(s)
          ---------------------------
          DATASTORE cdc://%(HOST):%(PORT)/%(AGNT)/%(ENGINE)
          OF VSAMCDC
          AS CDCIN
          ACCEPT ALL 
          DESCRIBED BY DUMMY
          ;
          ---------------------------
          -- Target Datastore(s)
          ---------------------------
          DATASTORE cics://%(APPLID)/SQDACVSM/SQDV
          OF VSAM
          AS TARGET
          DESCRIBED BY DUMMY
          RRS
          ;
          ---------------------------
          -- 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,VSAMDDNAME(CDCIN)
          -- ,' CDCTSTMP=',CDCTSTMP(CDCIN)
          -- ,' CDCOP= ',CDCOP(CDCIN)
          -- ,' CDCSTCK= ',CDCSTCK(CDCIN)
          -- ,' CDCUOW=',CDCUOW(CDCIN))
          -- ,' CONTENT=',STRING(CDCRAW(CDCIN))
          -- CASE VSAMDDNAME(CDCIN)
          -- WHEN 'FILEA' SETTARGET(TARGET,'FILEAR')
          -- WHEN 'FILEB' SETTARGET(TARGET,'FILEBR')
          REPLICATE(TARGET)
          }
          FROM CDCIN;