Please enable JavaScript to view this site.

The CDC_METADATA function returns the value of the specified CDC metadata tag. This function is applicable only to Apply Engines writing JSON or AVRO formatted Kafka topics. These METADATA Header Tag values are automatically populated by the Apply Engine for each CDC source record before entering the Main processing loop. Most of this data can also be retrieved directly from the the CDC record using dedicated CDC functions.

Category

Changed Data Capture

Syntax

CDC_METADATA(object_name | alias | stck | timestamp | change_op | seq)

 

Parameter Descriptions

object_name  -  The name of the source datastore that contains the changed data capture (CDC) records.

alias  -  The alias of the description corresponding to the current record of the source datastore.

stck  -  The storeclock value corresponding to the time the source data was changed.

timestamp  -  The timestamp value corresponding to the time the source data was changed.

change_op  -  The single letter corresponding to the change operation that took place for the changed data capture (CDC) record.

seq  -  The generated sequence number of the next JSON or AVRO format HDFS record to be written. This sequence number is reset for every HDFS file opened.  

Example 1

Retrieve the change operation (CDCOP) value from the METADATA Header Tag automatically populated for the current changed data capture (CDC) record. This function is typically used in conjunction with AUTOMAP to add the additional metadata attribute value to a custom Target description. Map the result to the variable TGT_CDC_CHG_OP.

TGT_CDC_CHG_OP = CDC_METADATA(change_op)

 

Example 2

Retrieve the uow (UOW ID) value from the METADATA Header Tag automatically populated for the current changed data capture (CDC) record. Map the result to the variable V_SOURCE_UOW in displayable Hex format. The resulting value will in nearly all cases have little value if translated to either EBCDIC or ASCII/UTF-8 characters since one or more will have no valid character representation

V_SOURCE_UOW = CONVERT_CCSID(X2C(CDC_METADATA(uow)),1208,1047)

 

SQD1000I CDC_METADATA(uow)                               = C9D4E2E4404040400417FC9700000000

 

Notes:

This example, also used in the CDCUOW function example does contain the 8 charcter IMS subsystem ID as seen on z/OS.

SQD1000I X2C(CDC_METADATA(uow))                          = ÉÔâä@@@@ü—

SQD1000I CONVERT_CCSID(X2C(CDC_METADATA(uow)),1208,1047) = IMSU    SEL DCI Ü p

 

The initial X2C above results in a value that is still EBCDIC but displayed in the current Engine locale with several unprintable characters. The final statement converts that value into utf-8 (code page 1208), which in the IMS CDC use case only, includes four original EBCDIC "character" values as seen on z/OS with several other characters represented by their standard acronyms for the EBCDIC "control characters",  as seen on z/OS, e.g: SEL and DCI.