Page 1 of 1

Peeking the Duplicate record alone

Posted: Thu Nov 10, 2011 11:04 pm
by pandeesh
I am having a dataset which contain 372 records. If i put remove duplicates stage , only 371 records are getting passed.It shws only one duplicate is there.
I want to peek that 1 duplicate recrd alone.
Whats the simplest way?

a)I have tried to load the data to sequential file and planned to use uniq -d.
But i dont have permission to create a sequential file.

b)Even if i peek all the records, it's very difficult to find the duplicate recrd.

C)Another way i can think is having 372 records(Orginal dataset), and having 371 recrds in another dataset(Created after removing duplicates).Then using Change capture, we can capture .

Is there any simplest way to find that duplicate record in datastage?

Thanks

Posted: Thu Nov 10, 2011 11:14 pm
by chandra.shekhar@tcs.com
Try this One- Sort those 372 records based upon your key column and input them into a tranformer. Use stage variables there to find the duplicate record and take it to another output.

Posted: Thu Nov 10, 2011 11:18 pm
by pandeesh
I never used this approach. Could you please explain how to find duplicate using Stage Variable?
Thanks

Re: Peeking the Duplicate record alone

Posted: Thu Nov 10, 2011 11:20 pm
by SURA
Use sort stage and choose the option Create Key Change Column = True and take it in the following TFM.

DS User

Posted: Thu Nov 10, 2011 11:26 pm
by pandeesh
Ok. Good.So i need to filter out the recoord whose key column is not changed in Transformer.For this, i guess no need of StageVariable.
Constraint is enough right?
I ll try this and let you know.
Thanks

Posted: Thu Nov 10, 2011 11:45 pm
by jwiles
Yes, to use this method you do need to use stage variables, which will hold the key values from the previous record and set a "flag" to use in your constraint

Alternatively, you can generate a Key Change column in your sort stage and simply check the value of that column for 0 in your transformer, which will indicate the duplicate record (based on the sort key values).

Regards,

Posted: Thu Nov 10, 2011 11:55 pm
by pandeesh
Thanks All!It worked!!