Error while writing null value to date column in seq. file

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
MukundShastri
Premium Member
Premium Member
Posts: 103
Joined: Tue Oct 14, 2003 4:07 am

Error while writing null value to date column in seq. file

Post by MukundShastri »

Hi ,
getting following error:
"Sequential_File_5: When checking operator: When validating export schema: At field "UPD_DATE": "null_field" length (1) must match field's fixed width (19)"
while writing the null value in the date field 'UPD_DATE' which is of type timestamp in the output sequential file. I am writing from an input dataset into the seq. file using a transformer stage . To handle null values coming to this field, in the transformer i am giving following derivation If IsNotNull(DSLink3.UPD_DATE) then DSLink3.UPD_DATE else TimeDate(). Still the above error is coming.

Please inform how this null handling can be done.

Thanks
Mukund
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

Hi,

What is the length of the target field UPD_DATE. If you use TimeDate() function to handle null . It will generate the time and string in the format : %yyyy-%mm-%dd %hh:%nn:%ss, It is total length of 19 charcters. Now, as per my analysis, what I am thinking is your Target filed UPD_DATE length is given as 1 and you are providing the 19 length default value for null. So, check the length. It will avoid the warning if it is 19.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

You need to give null field value for the nullable column in the "edit column dialog box". The null field value should match the column length.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need to set the Null Field Value property (from the Edit Row dialog) even though you've handled nulls upstream. The value that you specify is what is written into the file if a null arrives on the input link. Alternatively, change the Nullable property to "No".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

Hi,

If you are handling the nulls in the transformer it self, then make it nullability to NO in the transformer itself. then there is no need to change in the sequential file. If you want the target field as nullable Yes, then You need to set the Null Field Value property (from the Edit Row dialog) even though you've handled nulls upstream.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
bnoland99
Participant
Posts: 2
Joined: Wed Oct 11, 2006 9:08 am

Getting error

Post by bnoland99 »

When I add the Null field length setting in, I get this:

"null_length" may only be used in conjunction with prefix length or link length

I was trying to add it in the seq file Edit Column Metadata window.

Thanks
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Check if this link helps.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
Post Reply