SETURLKEY - 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
Last edition
2024-07-30
Last publish date
2024-07-30T20:19:56.898694
The SETURLKEY function provides an alternative to the default Topic partitioning options provided by the Kafka DATASTORE url.
DATASTORE kafka://.../...[/<partition> |/key |/root_key |/]

Category

Specialized

Syntax
SETURLKEY(<target_datastore>, <concatenated_key>)
Parameter and Description
Parameter Description
<concatenated_key> Any combination of literals, variables, source alias references and source data concatenated to create a partitioning key.

Example 1

Partition Kafka topics using both the both the source data key and the abbreviated State from the source table change data records.
DESCRIPTION DB2SQL ./DB2DDL/EMP.ddl AS EMP;
DESCRIPTION DB2SQL ./DB2DDL/DEPT.ddl AS DEPT;
DATASTORE kafka:///cdc_*_db2/
CREATE PROC P_EMP AS SELECT
{
SETURLKEY(TARGET, STRING(EMP.STATE_ABRV, EMP.EMP_NO))
REPLICATE(TARGET, EMP)
}
CREATE PROC P_DEPT AS SELECT
{
SETURLKEY(TARGET, STRING(DEPT.STATE_ABRV, DEPT.DEPT_NO))
REPLICATE(TARGET, DEPT)
}

Example 2

Partition Kafka topics using both the both the source data key and the IMS Source System Instance from the source segment change data records.

-- Define the source as IMS change data and the target as Kafka
DESCRIPTION IMSDBD ./IMSDBD/HREMPLDB.dbd AS HREMPLDB;
BEGIN GROUP IMS_SEG;
DESCRIPTION COBOL ./IMSSEG/EMPLOYEE.cob AS EMPLOYEE
                FOR SEGMENT EMPLOYEE
                IN DATABASE HREMPLDB
;
END GROUP;
DATASTORE kafka:///topic_prefix_*_topic_suffix/             -- specify dynamic topic
        OF JSON                          
        AS TARGET
        DESCRIBED BY GROUP IMS_SEG       -- use source for REPLICATE
;
CREATE PROC P_EMPLOYEE AS SELECT
{
V_SOURCE_SYSTEM_INSTANCE = CONVERT_CCSID(X2C(LEFT(CDCUOW(CDCIN),8)),1208,1047)
SETURLKEY(TARGET, STRING(V_SOURCE_SYSTEM_INSTANCE,EMPLOYEE.EMP-NO))
REPLICATE(TARGET, EMP)
}