Change Capture stage with duplicate after link

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jiangyf@cn.ibm.com
Participant
Posts: 3
Joined: Thu Dec 04, 2008 11:25 pm

Change Capture stage with duplicate after link

Post by jiangyf@cn.ibm.com »

before link
KEY1,KEY2,Data1,Data2

After Link
KEY1,KEY2,Data1,Data2
KEY1,KEY2,Data3,Data4

as you can see there is duplicate key value in after link

I set up on job with Change capture with reject copy option.

but i got KEY1,KEY2,Data3,Data4 as new record and should be insert

and duplicate error when insert

do you know why?
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

From the guide: "The Change Capture stage takes two input data sets, denoted before and after, and outputs a single data set whose records represent the changes made to the before data set to obtain the after data set."

I think the first pair of records, the copy, did get rejected, and that action consumed them, then the stage moved on to compare the next record(s) available.

Double check to make sure that your before and after link ordering is correct or if it needs to be swapped.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Change capture stage needs unique keys on both inputs. As noted by qt_ky, it is a simple 2-file match process on ordered inputs... once a record is consumed on an input it is no longer available for the next key comparison.

Mike
jiangyf@cn.ibm.com
Participant
Posts: 3
Joined: Thu Dec 04, 2008 11:25 pm

Post by jiangyf@cn.ibm.com »

I see Thank you Mike
Post Reply