Page 1 of 1

writting dulicate records in a file

Posted: Wed May 16, 2007 12:37 am
by amitaguptain
Hi,

I have a requirement where i need to write the dulicate records occuring in the source file on the basis of some key to the target file.

How can handle this in datastage?
Can i have some counter (constriant )

Thanks,

Posted: Wed May 16, 2007 12:52 am
by ray.wurlod
Yes and yes.

Posted: Wed May 16, 2007 2:02 am
by amitaguptain
Can u tell me how to define stage variable in this case

Posted: Wed May 16, 2007 2:47 am
by JoshGeorge

Posted: Wed May 16, 2007 6:39 am
by ray.wurlod
Run the data through a Sort stage, and get the Sort stage to create a key change column. In a downstream Transformer stage, the key change column will identify the beginning of each group - that is, of each set of duplicates. Constrain on the key change column - where it is reset (0) you have a duplicate.