Difference between Change Capture Stage and Difference Stage

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
pkothana
Participant
Posts: 50
Joined: Tue Oct 14, 2003 6:12 am

Difference between Change Capture Stage and Difference Stage

Post by pkothana »

It is required that one file is compared with another one (Master File) and we have to get the Delta Records i.e. records which are either new or changed. Can anybody tell me which stage to use Change Capture or Difference and why? As I am new to Data Stage I am little bit confused. Any help in this regard is highly appreciated.
Note: Both the files will be having around 28M records.

Thanks & Regards
Pinkesh
Peytot
Participant
Posts: 145
Joined: Wed Jun 04, 2003 7:56 am
Location: France

Post by Peytot »

The Change capture is most complet then the other stage. With the change capture you can compare 2 files New and historical (same description) and retrieve the difference between them : Insert, Update, Same or Delete (present in the second file but not in the first).
In the Output, you have a new column with an indicator and we can split the data depend on their value.
After you have the Stage Change Apply which update your historical file in comparing the historical file with the output file generated by the change capture.
The difference stage is not completed, not finished. It do an half that the change capture do and you do not have the change apply if you would like to update your historical file.

Change capture is a very good stage, you can filter your data.

Pey :P
Jay
Participant
Posts: 105
Joined: Tue Nov 11, 2003 8:28 pm

Post by Jay »

Need some help here...

I set values in the Change Capture as Delete code=2, Edit code =3, Insert code=1.

For actual inserts into the target tbl, what is happening is , change_code=2.

I am comparing two tables. I think waht is happening is for inserts, there are no rows in the 2nd table. So delete code = 2 is correct.

Any thoughts?

Thanks
Jay
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Your links are backward.

Click on "Link Ordering" under "Stage" tab, and ensure that your Before and After links correctly identify the input links you are using for this stage.
Jay
Participant
Posts: 105
Joined: Tue Nov 11, 2003 8:28 pm

Post by Jay »

T42,

Thanks for the idea...now its working good...

one more question....Edit code=3 is never set in my case....

I am changing the value of one of the columns....so for the same key it should give a change_code of 3.....

but it is giving a change_code of 2.

Any suggestions?

Thanks
jay
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Edit means that your value fields have been changed for the same key.

Changing your key make a mismatch, and thus, you have BOTH a new and a delete.
Jay
Participant
Posts: 105
Joined: Tue Nov 11, 2003 8:28 pm

Post by Jay »

Thanks, T42. It seems that the job is working fine.

I'll keep you posted...
Post Reply