How to handle null records for date column 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
snt_ds
Premium Member
Premium Member
Posts: 280
Joined: Wed Oct 18, 2006 11:53 am
Location: Pune, India

How to handle null records for date column in transformer

Post by snt_ds »

Hi,

I am getting issue with the date column. Could anyone please help me on this.

The End date and Begin date which are getting from the table with datatype Timestamp. Here in table we have NULL records for End Date. We are taking these records into the transformer and doing some validations.

The issue is if I run the job I am getting the warning like below.

APT_CombinedOperatorController(3),0: Field 'END_DATE' from input dataset '0' is NULL. Record dropped.



validations:

The validation is if the effective date lies between the begin date and End Date we need to take the record. Also if End Date is NULL and effective date is greater than or equal to begin date we also need to pass the record.

Eg:

Record1: Begin Date:01/01/2006 and End Date 'NULL'
Record2: Begin Date:01/01/2006 and End Date 01/01/2007

If Effective Date is 04/01/2006 and 04/01/2008 then these two records need to be populated into the target.



Thanks and Advance
Vamsi
hamzaqk
Participant
Posts: 249
Joined: Tue Apr 17, 2007 5:50 am
Location: islamabad

Post by hamzaqk »

Yes the irritating issue! you need to cater the null handling here yourself,

put something like

Code: Select all

 IF inputCol.END_DATE is null then '9999/12/31' Else inputCol.END_DATE
you can also do the null handling in the column definition of the source. and you can also define it non nullable in the target.
Teradata Certified Master V2R5
Post Reply