Today, I am gonna ask you a question, What value I will get from lookup when my datatype is integer (Not Null) and there is no match b/w source and reference data???
Generally, we say, NULL as there is no match b/w source and reference. But that's not true.
So let's see how the DataStage and Lookup behave :-)
When Source and Reference are NULLable -
- If there is no match b/ source and reference, we will get NULL in output
When Source and Reference are Not-NULLable -
- If there is no match b/ source and reference, we will get DataStage Defaults for that datatype.
such as - 0 for integer and empty string or '' for varchar when data is going out from lookup stage.
So, Be careful when you are planning to filter the data outside lookup stage based on referenced columns value as field in output file is not null, transformer stage don't receive a null (because it comes with the default value 0) and can't handle it as you expec.
Hoping, this will add one pointer in your learning. Let me know your thoughts in comment section.
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://datagenx.slack.com/messages/datascience/
No comments:
Post a Comment