Null handling in Sequential Files for decimal fields

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
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Null handling in Sequential Files for decimal fields

Post by sumesh.abraham »

Hi,

I have a situation where in i am reading from a sequential file and after some processing writing to a sequential file. It is a '|' delimited file.
I have decimal fields which are nullable.ex;UNIT_RETAIL(20,4)

Warning: When validating export schema: At field "UNIT_RETAIL": "null_field" length (0) must match field's fixed width (22).
Warning:When validating export schema: At field "UNIT_RETAIL": Exporting a fixed length field with a "null_field" of length 0 will prohibit a re-import of this field.


If there is a value in the nullable field,there is no issue.
only when it is empty I get the problem
If i give Null Field Value=''... it reads those decimal fields but gives warnings.
If I give Null Field Value=' ' (22) spaces it gives a diff warning saying no default value defined for a nullable field.

So i want to know how to handle the field when the source data is actually null.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Using " " (22 spaces) is the correct way to do it. What is the exact error you get when you use this value?
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Post by sumesh.abraham »

If I give Null Field Value=' ' (22) spaces it gives a diff warning saying no default value defined for a nullable field.
What could be causing this warning.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

How can we answer if you don't post the warning you get?
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

Search the forum for;
APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL

Set this to true and it should allow a zero length ('') for the NULL value in the decimal fixed width field upon export.
Post Reply