Writting NULL to a sequential 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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Writting NULL to a sequential File

Post by somu_june »

Hi,

I have a parallel job and I'm writting data to sequential file and it had a field sv9 with char(10) data type and in the field properties I mentioned Null value as 'NULLNULLNU' to get rid of the waring
When validating export schema: At field "sv9": "null_field" length (4) must match field's fixed width (10)

but when I see the data in the file for NULL values it has a data NULLNULLNU instead of NULL . Is there a way in parallel job that I can have a value NULL for NULL fields for char(10) lenght column with out a warning message like in server job if you mention in properties NULL it will assign NULL value for all the fields irrespective of their lengths For example for field1 char(1) contains a NULL value it assigns NULL eventhough it is char(1). Is it possible in parallel job or do I need to mention varchar(4) for field1

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

Post by ray.wurlod »

Only by changing the data type from CHAR to VARCHAR. Every value in a CHAR(10) field - including the null field value - must have precisely ten characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prakashdasika
Premium Member
Premium Member
Posts: 72
Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney

Post by prakashdasika »

If you still want to write NULL in to the fixed width file then try 'NULL ' in the CHAR(10) field
Prakash Dasika
ETL Consultant
Sydney
Australia
rohithmuthyala
Participant
Posts: 57
Joined: Wed Oct 21, 2009 4:46 am
Location: India

Post by rohithmuthyala »

Changing the datatype from CHAR to VARCHAR is a good option as the output is a Sequential file.
Rohith
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Thanks Every one
somaraju
Post Reply