CDCUOW |
Scroll |
The CDCUOW function returns the unit-of-work identifier (UOW ID) also referred to as the recovery token, from the changed data capture (CDC) record in a CDC type datastore. This function is useful for maintaining transactional integrity by grouping updates within a particular unit-of-work. Note: This function replaces the IMSCDCUOW and DB2CDCUOW functions, although these functions are still supported in Connect CDC SQData V4.
Category
Changed Data Capture
Syntax
CDCUOW(<source_datastore>)
Parameter Descriptions
source_datastore - The name of the source datastore that contains the changed data capture (CDC) records.
Note, both the content which is binary and the length will vary depending on the source:
Source |
Bytes Binary |
Bytes returned as displayable string |
---|---|---|
Db2/z |
10 |
20 |
IMS |
16 |
32 |
VSAM |
16 |
32 |
Example 1
Retrieve the unit-of-work identifier from the current record in the source changed data capture (CDC) datastore CDCIN. Map the result to target field SRC_UOWID.
SRC_UOWID = CDCUOW(CDCIN)
Example 2
Retrieve the IMS Source System Instance from the current record in the source changed data capture (CDC) datastore CDCIN. Map the result to the variable V_SOURCE_SYSTEM_INSTANCE.
V_SOURCE_SYSTEM_INSTANCE = CONVERT_CCSID(X2C(LEFT(CDCUOW(CDCIN),8)),1208,1047)
Notes:
1.The IMS UOW is 16 bytes binary in the CDCRAW record.
2.CDCUOW returns the UOW ID as a 32 character string of EBCDIC Hex characters as seen in the following step by step example:
CDCUOW(CDCIN) = C9D4E2E4404040400417FC9700000000
LEFT(CDCUOW(CDCIN),8) = C9D4E2E4
X2C(LEFT(CDCUOW(CDCIN),8)) = ÉÔâä
CONVERT_CCSID(X2C(LEFT(CDCUOW(CDCIN),8)),1208,1047) = IMSU
The initial X2C above results in a value that is still EBCDIC but displayed in the current Engine locale. The final statement converts that value into utf-8 (code page 1208) resulting in the original EBCDIC "character" value "IMSU" as seen on z/OS.