PROCESS INTO - connect_cdc_sqdata - Latest

Connect CDC (SQData) Apply engine

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) Apply engine
Copyright
2024
First publish date
2000
ft:lastEdition
2024-07-30
ft:lastPublication
2024-07-30T20:19:56.898694

The PROCESS INTO Command is used only once in the Apply Engine script and defines what is referred to as the Main Section of the script. It essentially initiates a processing loop beginning with the first record of the source datastore that continues until the last record from the source datastore has been processed.

It identifies the target datastore(s) that will be acted upon by the script and is used in conjunction with the FOR <action> parameter specified in the DATASTORE command for the target datastore which explicitly states how the data will be applied to the target. As described in the DATASTORE Command the default Actions are CHANGE and INSERT.

Syntax
PROCESS INTO <target_datastore> [, <target_datastore>]
SELECT [UNION];
Keyword and Parameter Descriptions
Keyword Description
<target_datastore>

Specifies the name(s) of one or more target datastores to which changed data records will be applied.

SELECT

The sub-command that identifies the records/rows to be read from a source datastore.

[UNION] Optional sub-command UNION can be used to chain or concatenate multiple SELECT sub commands together. This allows for multi-step processing against. See the UNION command for more details on its syntax and usage.

Examples for each DATASTORE FOR <action>

CHANGE Action:

Apply changed IMS data from a IBM MQ queue into the relational table TGT_TABLE. The source records are to be applied to the target table based on the change operation of the source transaction (i.e. insert, update, delete).

Note: The use of the KEY IS and OPERATION IS keywords in the target datastore definition. In this case, the key of the target table is COLA. The CDC change operation is designated as the field CHGOP, which is derived from the CDCOP function.
-- Specify the source/target data structures
DESCRIPTION COBOL  file_name AS SRC_DESCR;
DESCRIPTION COBOL  file_name AS TGT_DESCR;

-- Specify the source datastore
DATASTORE MQS:///CDC_QUEUE_IN
        OF IMSCDC
        AS CDCIN
        DESCRIBED BY SRC_DESCR;
		
-- Specify the target datastore with a key and change op reference
DATASTORE TGT_TABLE
         OF RELATIONAL
         AS TBL_OUT
         DESCRIBED BY TGT_DESCR
         KEY IS COLA
         OPERATION IS V_CHGOP
         FOR CHANGE;

-- Specify Variables
DECLARE V_CHGOP     1 ' ';

-- Specify the Processing
PROCESS INTO TBL_OUT
SELECT
{
   V_CHGOP = CDCOP(CDCIN)
   TBL_OUT.COLA = FIELD1
   TBL_OUT.COLB = FIELD2
}
FROM CDCIN;

INSERT Action 1:

Insert data from two segments in an IMS database into a single Oracle table by creating a comma delimited file that will be input to the Oracle Loader utility on a second platform. Note, this is an example of a refresh script that might be used once at initial implementation and then maintained as a backup to a real-time CDC Replication process also implemented using Connect CDC SQData
-- Specify the source/target data structures
DESCRIPTION COBOL  file_name AS SRC_DESCR;
DESCRIPTION COBOL  file_name AS TGT_DESCR;

-- Specify the source datastore --
DATASTORE AUTO_DETAIL
        OF RELATIONAL
        AS TBL_IN
        DESCRIBED BY SRC_DESCR;

-- Specify the target datastore with INSERT op reference --
DATASTORE AUTO_MASTER
         OF RELATIONAL
         AS TBL_OUT
         DESCRIBED BY TGT_DESCR
         FOR INSERT;

-- Specify the Processing
PROCESS INTO AUTO_MASTER
SELECT
{
   SALES_INFO.MAKE       = AUTO_DETAIL.AUTO_MAKE
   SALES_INFO.OWNER       = AUTO_DETAIL.AUTO_OWNER
}
FROM AUTO_DETAIL;

INSERT Action 2:

Insert two columns (AUTO_MAKE and AUTO_OWNER) from the source datastore AUTO_DETAIL into Target Source Datastore SALES_INFO.
-- Specify the source/target data structures
DESCRIPTION COBOL  file_name AS SRC_DESCR;
DESCRIPTION COBOL  file_name AS TGT_DESCR;

-- Specify the source datastore
DATASTORE AUTO_DETAIL
        OF RELATIONAL
        AS AUTO_DETAIL
        DESCRIBED BY SRC_DESCR;

-- Specify the target datastore with INSERT op reference
DATASTORE SALES_INFO
         OF RELATIONAL
         AS SALES_INFO
         DESCRIBED BY TGT_DESCR
         FOR INSERT;
		 
-- Specify the Processing
INSERT INTO  SALES_INFO
SELECT
{
   SALES_INFO.MAKE       = AUTO_DETAIL.AUTO_MAKE
   SALES_INFO.OWNER       = AUTO_DETAIL.AUTO_OWNER
}
FROM AUTO_DETAIL;