I have a source column with integer sequence, but the numbers are discontinuous.
Like 2, 4, 5, 6, 8, 25...... and so on.
There is no record count restriction, and I need only those numbers which are missing in the aource sequence as output.
like 1, 3, 7, 9, 10, 11, 12......
Please help.
Regards.
Identify missing numbers in a source column
Moderators: chulett, rschirm, roy
Identify missing numbers in a source column
Pain is the best teacher, but very few attend his class..
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You will need sorted data, and you will need to operate in Sequential mode.
Use a Transformer stage. Use stage variables to "remember" the value from the previous row. Use a loop to traverse the interval between that and the current row's value, sending values less than the current row's value to the collection of missed numbers.
You could do the same in a BuildOp if you wanted to code the C++ yourself.
Use a Transformer stage. Use stage variables to "remember" the value from the previous row. Use a loop to traverse the interval between that and the current row's value, sending values less than the current row's value to the collection of missed numbers.
You could do the same in a BuildOp if you wanted to code the C++ yourself.
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.
Thanks for the help Ray, but since I'm not a premium member, I'm not able to view your message fully.
But I've also tried using the same approach, but I'm not able figure out how to loop through the skipped numbers and retrieve their values.
Regards.
But I've also tried using the same approach, but I'm not able figure out how to loop through the skipped numbers and retrieve their values.
Regards.
Pain is the best teacher, but very few attend his class..
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Another approach might be to join/lookup with a complete list of numbers, which you could generate within the job. The beginning and end numbers could be provided as job parameters.
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.