How to write nulls as nulls

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
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

How to write nulls as nulls

Post by Vijay Kumar »

Hi,
I am getting the following warning message in the Job log:

Exporting nullable field without null handling properties

I am just reading a Oracle Table using Oracle Enterprise Stage and writing data into 2 sequential files based on some condition with out any transformations.

The job is as follows:

Oracle Enterprise Stage ---> Transformer --->(condition1) File1
---->(condition2) File2

The Null proterty was set to Yes for the fields which can have NULL value in both the source and Target.

Can any one help me out in resolving this warning issue?

Thanks in Advance.
Vijay
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Also check through out the links including transformer.
Turn off RCP.
Try using NullToValue() and set null again for null values.
What is the datatype?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post by Vijay Kumar »

kumar_s wrote:Also check through out the links including transformer.
Turn off RCP.
Try using NullToValue() and set null again for null values.
What is the datatype? ...
Thank you for the response.

RCP property is OFF and through out the job the Nullable property is set to Yes. All the fields are of Varchar Type.

As the amout of data that I am extracting is huge, I don't want to use NullToValue() function. If I use any operators it may slow down the performance.

Why the DS Job is throwing such warning msg when I don't perform any tranformations in my job. Can't we write Null value into a sequential file??
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You need to define the sequential file output handling of null values, this is where your error is originating. If you go into the output column in the designer, and right-mouse-click and do and "edit row" you will see the attributes that you can set for output.
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post by Vijay Kumar »

Do I need to set Is NullFieldValue=NULL in this case under the Edit Window??
If yes, then what is the use of NULLABLE field property??? Is it not sufficient if we define the NULLABLE property to 'Yes'

Thanks & Regards,
vijay
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

No, for PX writes to sequential files it is not sufficient to just state the nullability as "Yes", you need to set the properties. What have you tried?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no such thing as NULL in a text file - there is only text.

You use the Null Field Value property to specify how you want NULL to be represented when writing to the file. This can be any string you like in a delimited file, but must be of the correct width in a fixed-width format file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Server editon Sequential file is more polite in accepting the nulls when it has delimiter.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post by Vijay Kumar »

Hi Ray,
In my job I want to extract data from Oracle database using Oracle Enterprise Stage to a Sequential File.
I don't want to replace the NULL values in output file, so I did a direct mapping with out any Null handling or transformations.
But when I run the job the job log shows many warning message.

Is there any way I can avoid these warning messages without doing any transformation for null handling?

Thanks & Regards,
Vijay
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If you are bothered about additional overhead, use message handler, else use NVL in the database stage to convert the null to a value and nullableFieldValue to convert back the specified value to null.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Vijay Kumar wrote:Is there any way I can avoid these warning messages without doing any transformation for null handling?
No. The warning messages will always be generated in this case, because you need to be aware of the situation.

Either provide null handling or implement a message handler.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply