Reject 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

rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Reject file

Post by rajkraj »

Hi,
I have a job which loads data from a sequential file into a oracle table.
In the Oracle Enterprise stage,I am using the write method as upsert.
I have the option Output Reject records set to True.

I am directing the rejects into a sequential file.
I have set the Null Field value as \123 in the format column.
All the 10 columns in the sequential file are Nullable.
But i am getting a warning for a decimal column as
below

When checking operator: When validating export schema: At field "XXX": "null_field" length (1) must match field's fixed width (8)

since this is a reject file i cannot modify the Null field value for each column.
How can i get around this error.

Thanks
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

define that at "field defaults"
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

But,when i define it at field defaults,it would not match all my columns(i.e some of them are Date column,some are varchar and some are decimals).

How can i define a single Null field value for all of them.

Thanks
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

Can some one,throw some light on this issue.

Thanks.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

set the field default to empty('')
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

When I set it to '' it gives the below error

When checking operator: When validating export schema: At field "XXX": "null_field" length (0) must match field's fixed width (8).

Thanks
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

Do avoid this warning,I have a Reject link from the Oracle Enterprise stage which is Input into a transformer and than from the transformer I have a sequential file where the rejects are landed (where it allows me to manipulate the Null by Field value).

Is there a better way to handle Null fields in a reject link.Any other suggestions on how to do this.

Thanks
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

Can some one throw some light on this matter.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The value that represents null must, for certain data types and for fixed-width format records, have the same number of characters as defined for the column. For example, for a date in %yyyy-%mm-%dd format (ten characters) the null-equivalent value must have ten characters, though it does not have to be a valid date. 0000-00-00 would be a suitable choice.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

Yes,Ray agree with you that it should have same format and size of characters or numbers to represent a null.

My question is as a Sequential file (which stores rejects from a Oracle Enterprise stage) does not allow Null field value to be edited,I am placing a transformer in between a Oracle Enterprise stage and sequential file which stores rejects(where in i am entering a Null field vale for columns which are Nullable in Oracle Enterprise stage).
I want to know if what i am doing is right.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A Sequential File stage always allows Null Field Value to be edited provided, of course, that the field is marked as Nullable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

Ray, If it is a reject link from a Oracle Eneterprise stage ,it is not allowing null field value for individual column in the sequential file.It allows a Null Field value only in the Format tab of the sequential file.So I gave Null field value as " " in the format tab,but since some of the columns are dates ,some are decimals and others are characters,I am getting an error.
How do you overcome this error.

Thanks
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

Ray, I just tried this and it seems that a sequential file hanging off a DB2 reject link does not allow editing of the field properties.
All the fields are shown in grey and seem to be read only.

I suspect the best option here is to include a transformer in the stream and perform null handling there.
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

Intuitively, I believe adding this to the Project and setting it to True along with a NULL Field default of '' (empty) will solve your problem;

APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL
rajkraj
Premium Member
Premium Member
Posts: 98
Joined: Wed Jun 15, 2005 1:41 pm

Post by rajkraj »

That is the reason I am putting a transformer in between and handling nulls. But i wanted to know if there was any effective method to handle this.

Thanks
Post Reply