Page 1 of 1

Null handling in fixed width file with

Posted: Wed Dec 15, 2010 7:09 am
by sultan@cts
Date format not matching when null is coming in date fied for the fixed width file, which is reading entire string as single fiels.
sample warning:
tfpDateProcess,0: Data string ' ' does not match format '%yyyy%mm%dd': an integer was expected to match tag %yyyy.
tfpDateProcess,0: Conversion error calling conversion routine date_from_string data may have been lost

Input string is like
04568444444 620101215A
04568444444 6xxxxxxxxA

i want to handle the null part of date with some default value.
Note:null is marked as xxxxxxxx

Re: Null handling in fixed width file with

Posted: Thu Dec 16, 2010 1:09 am
by sultan@cts
Hi Experts,

Any help will be appreciated.

Posted: Thu Dec 16, 2010 1:14 am
by ray.wurlod
In a fixed-width file format the entire field must be filled with the representation of NULL. That is, the Null Field Value property must contain the same number of characters as indicated by the Display Width property. In this case, the data type is Date, so the format string for date comes into play. Therefore xxxxxxxx is not accepted, but 99991231 would be.

Posted: Thu Dec 16, 2010 4:27 am
by rohithmuthyala
You can read the values as Char or Varchar and then handle it in the next stage.

Null handling in fixed width file with

Posted: Thu Dec 16, 2010 6:07 am
by ajay.vaidyanathan
Hi Sultan,
You will have the NULL handling property in the source stage where you can set the default date (may be '19000101') and then try executing your job.