| Change type | Description |
|---|---|
| Updated in version 5.0.6 | Added uow, userid, and uuid to the CDC_METADATA function syntax and parameter descriptions. |
| Updated in version 5.0.6 | Updated applicability statement to include Protobuf formatted Kafka topics. |
The CDC_METADATA function returns the value of the specified CDC metadata tag. This function is applicable only to Apply Engines writing JSON, AVRO, or Protobuf 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 CDC record using dedicated CDC functions.
Category
Change Data Capture
CDC_METADATA(object_name | alias | stck | timestamp | change_op | seq | uow | userid | uuid)
| Parameter | Description |
|---|---|
| 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. |
| uow | The Unit of Work ID for the current CDC record. CDC_METADATA(uow) returns the unit-of-work identifier as a hexadecimal value when the source record contains one. |
| userid | The User ID associated with IMS CDC input. CDC_METADATA(userid) is supported for IMS CDC input only and is not equivalent to Replicator Engine METADATA(userid), which also supports Db2 for z/OS source user IDs. |
| uuid | The UUID (Universally Unique Identifier) associated with the current CDC record. The CDC_METADATA(uuid) function returns the formatted UUID when the current CDC record contains a UUID; otherwise, it returns null. |
Example 1
TGT_CDC_CHG_OP = CDC_METADATA(change_op)Example 2
V_SOURCE_UOW = CONVERT_CCSID(X2C(CDC_METADATA(uow)),1208,1047)
SQD1000I CDC_METADATA(uow) = C9D4E2E4404040400417FC9700000000SQD1000I X2C(CDC_METADATA(uow)) = ÉÔâä@@@@ü—
SQD1000I CONVERT_CCSID(X2C(CDC_METADATA(uow)),1208,1047) = IMSU SEL DCI Ü pThe 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.