For example we have Customer table
In customer table
we have a c_id and c_name
c_id c_ name
11 a
11 b
22 c
33 d
44 e
22 f
11 g
33 h
44 i
And my question is
There should be 2 targets and
in Target 1 I need all uniques ids
and in Target 2 I need all duplicates
Can any one send me the full condition we need to write.
I have taken seqfile as a source to read the data
and I have taken sort stage to sort the data
and from there i have taken transformer stage
and I need to write condition there.
Tell me the condition I need to write exactly.
To get the answet in the Target .
Thanks in advance
can any one tell example for datastage functions
Moderators: chulett, rschirm, roy
Have you read the documentation for the Sort stage to understand what the keyChange column option provides you and the values it will contain? It's in the Parallel Job Developer Guide.
As a quick exercise, imagine you have a column on your records which uses two distinct values to indicate whether or not a record is the first record of a group of duplicates. In a constraint within a transformer, how would YOU write the logic to select only the first record? In another constraint, how would YOU write the logic to select only the duplicates?
Regards,
As a quick exercise, imagine you have a column on your records which uses two distinct values to indicate whether or not a record is the first record of a group of duplicates. In a constraint within a transformer, how would YOU write the logic to select only the first record? In another constraint, how would YOU write the logic to select only the duplicates?
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
There's no "if-then-else" needed here. You have two output links and always fully populate both sets of columns with the same data. The key is the constraint so that only one or the other 'fires' for each record and the constraint can make use of the Key Change column.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Vertical pivot. Search DSXchange for examples.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 47
- Joined: Thu Dec 09, 2010 4:37 am