Page 1 of 1

Null Handling Issue In Transformer

Posted: Tue May 09, 2017 1:00 pm
by jerome_rajan
Hi All,
I'm facing a weird sort of an issue. I have an attribute that carries a NULL value. When I try to perform logical operations using IsNull(variable), the transformer doesn't seem to be able to recognize it as a null. However, when I do a Seq(variable) to check the actual value, I get a 0 which is the ASCII for NULL. Trying to perform these operations within a stage variable

Anyone else who has experienced this?

Posted: Tue May 09, 2017 1:43 pm
by koti9
Hi Jerome,

Are you adding any operators with IsNull Clause ie. IsNull(SourceColumn1) And Len(Trim(SourceColumn1))=0, If yes then try to split it out like below in Stage Variable.

Code: Select all

If IsNull(SourceColumn1) Then "Do Something" Else (If  Len(Trim(SourceColumn1))=0 Then "Do Something" Else "Something Else")
Thanks & Regards
Koti

Posted: Tue May 09, 2017 3:05 pm
by jerome_rajan
Found the issue.

The value was not technically a NULL for DataStage. It was a string of length 0 which Oracle treats as a NULL but not DataStage.

Seq(Variable)= 0 does not represent a NULL
Seq(Variable)=NULL represents a NULL

Posted: Tue May 09, 2017 3:18 pm
by chulett
... was wondering if that might be the case but you didn't mention the "O" word. :wink: