Page 1 of 1

Handling Nulls for decimal fields in transformer stage

Posted: Wed Sep 13, 2017 3:25 pm
by Developer9
Hi,
My requirement is If there are NULLs present in source (Oracle table) for decimal fields then I need to convert them into Blanks in target (Flat file ).

Code: Select all

oracle (source) > Leftouter Join >XFM > DataSet >cdc >Flatfile
Transformer derivation ,I wrote

Code: Select all

If IsNull(lnk_col1) Then '' Else lnk_col1
After I perform the "Left outer Join" ,these decimal fields returning 0 (Zero) instead NULL .

I read the forum posts ,Its the expected behavior for decimal fields .But How Can I perform null handling for decimal fields ?

Please suggest me how to handle this in transformer stage ?

Thanks.

Posted: Wed Sep 13, 2017 3:33 pm
by chulett
From what I recall, you would need to define them as string fields in the flat file and then format them accordingly.

Posted: Wed Sep 13, 2017 5:03 pm
by cdp
Are your decimal columns nullable in both of the Input links of your Join Stage ?
If you have defined your decimal columns as non-nullable in DataStage, I think it will default the NULLs to 0 ?

Also, you may prefer to use the NullToEmpty() function instead of the If IsNull() Then '' .. Else ... syntax
https://www.ibm.com/support/knowledgece ... tions.html