I have a file with account records. I want to detect duplicate account numbers and send the duplicate records to a reject file.
I sort the file by account number and then have an input link into a transformer.
I have 2 output links from the transformer. Each output link has a constraint defined on it.
On the first link the constraint is:
NOT(RowProcCompareWithPreviousValue(FromSrtByOldMcNumber.CCD_OLD_ACCT))
On the second link the constraint is:
RowProcCompareWithPreviousValue(FromSrtByOldMcNumber.CCD_OLD_ACCT)
I have 9,075 records going into the transformer and each output link has 9,075 records coming out. In other words I have all records coming out of each output port. But the constraints are identical except for the "NOT".
Can someone tell me what is happening?
Detecting and rejecting duplicate records
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Hi,
Try assigning to a stage variable, say "rowstatus".
and use that stage variable in the constraints as rowstatus and NOT(rowstatus).
Coz i come across in some part of documentation, that that function should be used only one part in a job.
Probably my perception may be right if it works.
regards
kumar
Try assigning to a stage variable, say "rowstatus".
and use that stage variable in the constraints as rowstatus and NOT(rowstatus).
Coz i come across in some part of documentation, that that function should be used only one part in a job.
Probably my perception may be right if it works.
regards
kumar
We do the same thing for one of our processes. We did just as kumar suggest.
We have a stage variable called svDupAcctNbr and its derivation is
RowProcCompareWithPreviousValue(sorted.Account_Number)
The first links constrain is Not(svDupAcctNbr)
and the second link doesn't have a constraint, but is marked as a reject link.
it works great.
Your code might work if you clear out the second constraint and just mark the link as a reject link, but I like using stage variables.
We have a stage variable called svDupAcctNbr and its derivation is
RowProcCompareWithPreviousValue(sorted.Account_Number)
The first links constrain is Not(svDupAcctNbr)
and the second link doesn't have a constraint, but is marked as a reject link.
it works great.
Your code might work if you clear out the second constraint and just mark the link as a reject link, but I like using stage variables.
Hi dale,DaleK wrote:We do the same thing for one of our processes. We did just as kumar suggest.
We have a stage variable called svDupAcctNbr and its derivation is
RowProcCompareWithPreviousValue(sorted.Account_Number)
The first links constrain is Not(svDupAcctNbr)
and the second link doesn't have a constraint, but is marked as a reject link.
it works great.
Your code might work if you clear out the second constraint and just mark the link as a reject link, but I like using stage variables.
If both the link needs to be used for future calculation or transformations, then processing in reject link wont be a good practice right.
regards
kumar