Capture Duplicate Records

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
deepak.shanthamurthy
Participant
Posts: 17
Joined: Tue Apr 11, 2006 2:35 pm

Capture Duplicate Records

Post by deepak.shanthamurthy »

Hi
am trying to capture duplicate records
i have sorted the records on the key
and am using the following code as stage variables.

Var = Key
flag = If Var = Var2 Then "Duplicate" Esle "NO"
Var2 = Var

But this is not giving me the results

Though i see in my debugger that var2 is retaining the old value of var the flag is always being set to Duplicate!!!!!

not sure where the problem is ???

Any help is appreciated

Thanks
Deepak
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If Var2 (Previous record) is same as Var (current record), it should give you "Duplicate".
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You should get "duplicate" when the value of Key is the same as in the previous row. And, with the logic you've stated (ignoring the typo for Else) you should get "NO" when the value of Key is different from that in the previous row. If this isn't happening, check your work, particularly your stage variable names, closely.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply