Null handling in fixed width file with

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
sultan@cts
Participant
Posts: 31
Joined: Thu Jul 05, 2007 11:57 pm
Location: India
Contact:

Null handling in fixed width file with

Post 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
Thanks
Sultan
sultan@cts
Participant
Posts: 31
Joined: Thu Jul 05, 2007 11:57 pm
Location: India
Contact:

Re: Null handling in fixed width file with

Post by sultan@cts »

Hi Experts,

Any help will be appreciated.
Thanks
Sultan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rohithmuthyala
Participant
Posts: 57
Joined: Wed Oct 21, 2009 4:46 am
Location: India

Post by rohithmuthyala »

You can read the values as Char or Varchar and then handle it in the next stage.
Rohith
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

Null handling in fixed width file with

Post 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.
Regards
Ajay
Post Reply