Null Handling Issue In Transformer

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
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Null Handling Issue In Transformer

Post 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?
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
koti9
Participant
Posts: 52
Joined: Wed Nov 09, 2005 10:51 am

Post 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
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post 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
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... was wondering if that might be the case but you didn't mention the "O" word. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply