Used Constraint REJECTEDCODE <> DSE.NOERROR the results was the first rec was written to the reject_tbl. The RECECTEDCODE Constraint is in 2nd output link, testing link 1 for non-numeric data.
Using REJECTEDCODE = DSE.NOERROR all records written to both tables. Can not find any documentation to assist in this. any advice is greatly appreciated.
Rejecting non-numeric fields
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard! :D
Read more about link variables; you may find it more appropriate to use LinkName1.REJECTED to determine whether a row was rejected by whatever the Put() function is on output link LinkName1.
But, to reject non-numeric input fields, an easier constraint expression would be on the main output link. In this way, there is not even any attempt to send them out along this link.
Read more about link variables; you may find it more appropriate to use LinkName1.REJECTED to determine whether a row was rejected by whatever the Put() function is on output link LinkName1.
But, to reject non-numeric input fields, an easier constraint expression would be
Code: Select all
Not(Num(InputLink.ColumnName))
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 Welcome and the advice. :D
I did use the num constraint at first and it did work, as long as you know what coulmn is suspect. My problem is that there can be dirty data in any numeric coulmn for any of the tables that we are loading from our Legacy system, no way to know ahead of time. I'm trying to set a trap that will reject any coulmn.
I did use the num constraint at first and it did work, as long as you know what coulmn is suspect. My problem is that there can be dirty data in any numeric coulmn for any of the tables that we are loading from our Legacy system, no way to know ahead of time. I'm trying to set a trap that will reject any coulmn.
Charlie
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi ccatania,
If you dont know ahead of time which field you want to test for non-numeric, then apply the Num test to all the columns that shouldn't have any non-numeric values
and in the
Alternatively
You can declare a stage variable which you can populate with a flag of 'Y' or 'N' based on Num test of all your numeric fields and then use these flag values as constraints for the output link and the reject link.
If you dont know ahead of time which field you want to test for non-numeric, then apply the Num test to all the columns that shouldn't have any non-numeric values
Code: Select all
Output link
Num(InputLink.ColumnName1) And Num(InputLink.ColumnName2)
Code: Select all
Reject link
Not(Num(InputLink.ColumnName1)) Or Not(Num(InputLink.ColumnName2))
You can declare a stage variable which you can populate with a flag of 'Y' or 'N' based on Num test of all your numeric fields and then use these flag values as constraints for the output link and the reject link.
Thanks,
Naveen
Naveen
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
<paranoia>If there's a chance it will be dirty you have to check.</paranoia>My problem is that there can be dirty data in any numeric coulmn for any of the tables that we are loading from our Legacy system, no way to know ahead of time. I'm trying to set a trap that will reject any coulmn.
One of the fundamental requirements of a data warehouse is that it contains good data. One of the fundamental tenets of good ETL practice, therefore, is to deliver data that are guaranteed to be good, whatever that means in the particular business context.
There is no convenient mechanism within DataStage to construct a global test. One way would be to construct a routine to which you pass a list of all the numeric columns' values, and which tests that each is numeric returning a true/false result. Or separate stage variables. But, whatever you do, you will at some point need to process each column value, even if just to build the list.
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 Ray,
I think I already knew this, but I was being optimistic at the least that there may be a global solution to this problem. You are 100% correct the DW has to be clean unfortunately they did not take that in consideration when they built the Legacy system I am extracting this data from. Building a pre-Transform process, which I'll dub the 'Cleaning Cycle', will definitely be required. I want to thank you again for you assistance as well as all others members who have replied.![Smile :)](./images/smilies/icon_smile.gif)
I think I already knew this, but I was being optimistic at the least that there may be a global solution to this problem. You are 100% correct the DW has to be clean unfortunately they did not take that in consideration when they built the Legacy system I am extracting this data from. Building a pre-Transform process, which I'll dub the 'Cleaning Cycle', will definitely be required. I want to thank you again for you assistance as well as all others members who have replied.
![Smile :)](./images/smilies/icon_smile.gif)
Charlie