Change capture stage logic

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
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Change capture stage logic

Post by India2000 »

Hi all,

I have a scenario where I need to load data from the source to target in SCD-II mode.

I have used Change capture stage in DS to identify Inserts and updates. I have the explicit keys and all values in the mode.

example..
In the year 2000 If I get a record with keys

Key1: 0000001B_

Key2: 0.6

In the year 2001

Key1: 0000001B_

Key2: 0.6

I get the same key in the year 2001

As per my understanding DS change capture stage has to generate change code() 3 for this record.

I get change code () =1 (insert) for the all the subsequent years even if I have the matching keys with change in other fields

Can anyone please let me know the reason for change capture not generating the desire result.. I have sorted bot the previous and current dataset on key1 and key2.

Thanks
priyadharsini
Participant
Posts: 40
Joined: Mon May 11, 2009 12:19 am
Location: Madurai

Post by priyadharsini »

did you trim your keys before doing the change capture?
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Post by India2000 »

Yes I did as one key is char.I dont i need to trim other Kay as its decimal
priyadharsini
Participant
Posts: 40
Joined: Mon May 11, 2009 12:19 am
Location: Madurai

Post by priyadharsini »

Check if any special character or space is getting padded in any of your inputs.
crystal_pup
Participant
Posts: 62
Joined: Thu Feb 08, 2007 6:01 am
Location: Pune

Post by crystal_pup »

1) Make sure that the input metadata in Change Capture stage for the key columns is exactly the same and the key columns have their key property checked.
2) The key column(s) should be key partitioned.
3) If the above 2 steps still don't give desired result, then try to verify the process by specifying just one column as the key column and check the output. If it looks good, then introduce the another column and again check the output.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

1. change capture expects only one record per key from both input links. Are you getting multiple records in source links?
2. Are both input streams key partitioned in the same key? Is metadata of the key columns same? Even unicode in one and not it another can make it not match.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Post by India2000 »

@Priyadarshikunal,

whatever you said the point 2 is correct. I saw your post later.. Once I made that change it worked.!

Thanks
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

Post by India2000 »

thanks all..
Post Reply