IsNotNull function not working fine for me

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
manuel.gomez
Premium Member
Premium Member
Posts: 291
Joined: Wed Sep 26, 2007 11:23 am
Location: Madrid, Spain

IsNotNull function not working fine for me

Post by manuel.gomez »

I guess this must be something so simple to solve, but I cant find a solution. Searched the forum for similar posts, but none helped

I do have an input dataset file, connecting to a Lookup as input link. This lookup has one more reference input, another dataset.

I lookup by one field, and set lookup stage on 'Continue' mode for unmatched records. On the lookup output, I do have all the columns for the upstream, plus one of the columns of the reference input (that goes out with a different name), set to be nullable (although in the reference input was not).

After that, I entered a Transformer to detect records that matched, and those did not. The idea is to have two outputs in the transformer:one for rows that matched, the other one for unmatched.

Let me try to paint it for you

Dataset2
|
|
|
|
DS1-----> Lookup ------> Transformer


To me, was clear that constraints for both output links were:

Code: Select all

IsNull(look1.COD_GR_EMP_FIC)
IsNotNull(look1.COD_GR_EMP_FIC)
Absolutely all rows came down through the second link, so, no null values

After that, I changed the constraint to these functions that always worked for me in Server jobs

Code: Select all

len(trim(look1.COD_GR_EMP_FIC))=0
len(trim(look1.COD_GR_EMP_FIC))>0
Worked just perfect. But I feel this is kind of "slang", not proper.
Do you have any idea what all values are not null, even when it is proof than with the second method, there are rows coming with empty field, instead of null (unmatched records).

This turns to be the same when the column to check if there was a match is numeric. In these cases, value coming in the field is zero instead of null.

Thanks very much for your help
manuel.gomez
Premium Member
Premium Member
Posts: 291
Joined: Wed Sep 26, 2007 11:23 am
Location: Madrid, Spain

Post by manuel.gomez »

nobody can help?
thanks
syeed
Participant
Posts: 19
Joined: Fri Jan 19, 2007 12:35 am
Location: bangalore

Re: IsNotNull function not working fine for me

Post by syeed »

Hi,

Please can you use diffrent Trim functions of datastage.

like TrimLeadingTrainling(), just try with this option.

Thanks,
Waseem
Syed
---------
Wait and Watch
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Is "look1.COD_GR_EMP_FIC" a key column for the lookup? The result of a TRIM() function (of any type) on a NULL value is always null.
manuel.gomez
Premium Member
Premium Member
Posts: 291
Joined: Wed Sep 26, 2007 11:23 am
Location: Madrid, Spain

Post by manuel.gomez »

ArndW wrote:Is "look1.COD_GR_EMP_FIC" a key column for the lookup?
No
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

And the column is declared as nullable and there is not default null value set for that column?
manuel.gomez
Premium Member
Premium Member
Posts: 291
Joined: Wed Sep 26, 2007 11:23 am
Location: Madrid, Spain

Post by manuel.gomez »

ArndW wrote:And the column is declared as nullable and there is not default null value set for that column?
Column is declared nullable in the lookup stage, but not in the upstream stage provinding the column (in this case, a dataset)

Default null value?? where do you set up that? I dont find any place to do it in the lookup stage
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Set it as nullable in the upstream stage, just to see. If you "edit row" on the column you can see and change numerous attributes, including how nulls are handled (if at all, in this case they shouldn't be handled). I assume that this link is the reference link in the lookup, not the column in the main data stream.
manuel.gomez
Premium Member
Premium Member
Posts: 291
Joined: Wed Sep 26, 2007 11:23 am
Location: Madrid, Spain

Post by manuel.gomez »

ArndW wrote:Set it as nullable in the upstream stage, just to see. If you "edit row" on the column you can see and change numerous attributes, including how nulls are handled (if at all, in this case they shouldn't be handled). I assume that this link is the reference link in the lookup, not the column in the main data stream.
I edit row but no option about null handling is giving. Actually, in the options field, I just see: None avaliable
Let me try what you suggest and I will give you result
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Nullable property must be "Yes" before the Nullable options become available.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
manuel.gomez
Premium Member
Premium Member
Posts: 291
Joined: Wed Sep 26, 2007 11:23 am
Location: Madrid, Spain

Post by manuel.gomez »

ray.wurlod wrote:Nullable property must be "Yes" before the Nullable options become available.
I did it, but as said, no options avaliable
Post Reply