import error and no default value for only one column?

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
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

import error and no default value for only one column?

Post by joesat »

The following error has already been discussed at length
Field "FIELD_NAME" has import error and no default value; data: <empty>, at offset: 132

But I am having a peculiar case.I have over 80 columns where I haven't specified any default values. But Datastage is throwing up this error only for one particular column which is in the 15th position. There are around 10 more columns having the same datatype and length, prior to this particular column, and where I have not specified any default. But no errors are shown for those fields.

Why should the error be shown for only one field and not the rest even though they have the same metadata?
Joel Satire
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Is this the first column of that datatype? If so, then it is probably because the engine parses left-to-right and stop when it encounters the bad one.
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

No, but this is the first column of the DECIMAL type which encounters a null value.

Once I set a default value for this field, the same error crops for another column FIELD_2 with the same decimal datatype.

I don't understand why this error should come up even after I have specified the NULL FIELD VALUE property. Why does it expect me to also give the DEFAULT property? What is the difference between the two properties?

Sorry for asking too many questions...but I guess there is no other way :D
Joel Satire
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Are you sure that it is getting a null value or just an empty value?
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

The file is a pipeline delimted file. Let me give you a sample

0|44.65|0.00|44.65|44.65||

As you can see the last column doesn't have any value. Does that mean it is empty or is it null? I am not sure...
Joel Satire
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It quite definately is empty and not null. Sequential files don't have null columns.
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

Earlier when I did not give the NULL FIELD VALUE property, I got the following error:

Sequential_File_3: When checking operator: When validating export schema: At field "FIELD_NAME": Exporting nullable field without null handling properties

so the best way to get out of this situation is to specify both NULL FIELD VALUE and the DEFAULT properties, is it not?
Joel Satire
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

if you have
a||c
and all are varchar fields , the second field will be imported as "Empty space".
For other datatypes , this is not the case . There will be warnings and the records will be dropped if reject file is not mentioned.

Nutshell:Varchar fields are read as "Empty spaces" unless specifically NULL Field value is specified , not true for other datatypes.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

if you have
a||c
and all are varchar fields , the second field will be imported as "Empty space".
For other datatypes , this is not the case . There will be warnings and the records will be dropped if reject file is not mentioned.

Nutshell:Varchar fields are read as "Empty spaces" . if these have to be taken as NULL , NULL Field value needs to be specified , for other datatypes this is not quite the case.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try also setting the Default property for the appropriate data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

so what exactly is the difference between a NULL field and an EMPTY field?

For example, my record looks like this in a sequential file:

10.00||20.00

where all the fields are decimal values.

But when I use the View Data option in Datastage, the record is displayed as
10.00 NULL 20.00

So how does one differentiate a NULL field from an EMPTY field?
Joel Satire
Post Reply