NULL record dropped issue for decimal to varchar col

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
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

NULL record dropped issue for decimal to varchar col

Post by HemaV »

My reference ora stage contains a column salarythousands with decimal datatype

Im performing left outer join of above reference ora stage with my source ora stage and passing field value to transformer.

in transformer im doing calculation as:
stagevariable1 with datatype decimal 11,

stagevariable1 = If IsNull(lk.salarythousands) Or Trim(lk.salarythousands) = "" Then 0
Else ((lk.salarythousands * 1000) / 12)

then passing to target column with varchar datatype as DecimaltoString(stagevariable1)

but still im getting the below error:
Trans_Land,3: Field 'salarythousands' from input dataset '0' is NULL. Record dropped.

Please let me know how to resolve this issue.

Thanks,
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Is it possible that you are using the column "salarythousands" to derive some other column without handling nulls than the one mentioned?
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Post by HemaV »

salarythousands is the original column im using till transformer and then doing calculations.

Problem is salarythousands is decimal datatype and im loading into varchar datatype column in transformer.

Also its using multinode configuration.

Thanks,
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

I doubt that the conversion is causing the issue. Please check if any of your other target columns are using the column - "salarythousands". If yes, are any functions applied on it ?
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

Which version of DataStage are you working with?

In 8.5 and higher this should work when Legacy-Null-handling is switched off on the transformer properties.

In versions prior to 8.5 it was not allowed to pass NULL-values to Transformer-functions as input. In case this happened on any column or stage-variable the complete record was dropped.

And then: why do you use a string-function on a column with decimal-datatype in the first place:

Use
stagevariable1 = If NullToZero(lk.salarythousands) = 0 Then 0
Else ((lk.salarythousands * 1000) / 12)
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

BI-RMA wrote:In 8.5 and higher this should work when Legacy-Null-handling is switched off on the transformer properties.

In versions prior to 8.5 it was not allowed to pass NULL-values to Transformer-functions as input.
My new learning for the day. Don't know how I missed it this long!
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Post by HemaV »

After using NullToZero function i'm not getting the warnings.

Thanks,
Post Reply