problem in null handling

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
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

problem in null handling

Post by arnie_nits »

Hi

I am having a problem with null handling. My code in tranformer derivation is-
If In_Tfm_EmpId_Customer.TRAN_TYPE='EMPSALE' AND In_Tfm_EmpId_Customer.CUSTOMER<>' ' Then NullToValue(In_Tfm_EmpId_Customer.ASSOC_ID,' ') Else NullToValue(In_Tfm_EmpId_Customer.EMP_ID,' ')

But still I am getting null values.

Please help

Regards
Arnie
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need some NullToValue() - or other null handling function - in the test expression portion of the If expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

The Null values are a bit tricky here.

Seems, for these 2 fields you are getting Null values from the source.
And you are not making Null checks for In_Tfm_EmpId_Customer.TRAN_TYPE, In_Tfm_EmpId_Customer.CUSTOMER.


The code would be this way:

Code: Select all

If NullToEmpty(In_Tfm_EmpId_Customer.TRAN_TYPE) ='EMPSALE' AND NullToEmpty(In_Tfm_EmpId_Customer.CUSTOMER) <> ''
Then NullToValue(In_Tfm_EmpId_Customer.ASSOC_ID,' ')
Else NullToValue(In_Tfm_EmpId_Customer.EMP_ID,' ') 
Thanks and Regards!!
dspxlearn
Post Reply