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 CDC record using dedicated CDC functions.
Category
Change Data Capture
CDC_METADATA(object_name | alias | stck | timestamp | change_op | seq)
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. |
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) = C9D4E2E4404040400417FC9700000000
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.