Null values in 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
nynali
Participant
Posts: 31
Joined: Thu May 03, 2007 11:52 pm
Location: Hyderabad

Null values in sequential file

Post by nynali »

Hi,
I have sequential file as output and the all the columns (about 4000) are nullable = YES type columns.
Now my questions are
>> will the seq file can store null values as is?
>>If I want to specify blanks/spaces (for both char and decimal columns) in case the coming value is NULL for that field,how can I do that?
>>Also is there any option in DS which will automatically fill the whole length of that column with spaces/blanks when I specify only 1 space/blank as default value?
nynali
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

The output schema is where you would specify all of the null handling. Is the output file fixed length or variable with field delimiters? If fixed length, you will need to specify the number of spaces to populate your "null" field. You don't necessarily need to do that for a variable length file but will probably get warnings that you should.

Check the documentation for sequential files, too.

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

Post by ray.wurlod »

1. No. Sequential files (text files) do not have data types, only text. Therefore they can not store NULL "as is". They can only store whatever the metadata specifies to be the representation of NULL.

2. If the file is a delimited format, there is a global property in the stage for the representation of NULL for each data type. If the file is a fixed width format, or if you want a different representation of NULL in some particular column(s), then you must provide specific Null Field Value property for each such field.

3. No.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nynali
Participant
Posts: 31
Joined: Thu May 03, 2007 11:52 pm
Location: Hyderabad

Post by nynali »

bcarlson wrote:The output schema is where you would specify all of the null handling. Is the output file fixed length or variable with field delimiters? If fixed length, you will need to specify the number of spaces to populate your "null" field. You don't necessarily need to do that for a variable length file but will probably get warnings that you should.

Check the documentation for sequential files, too.

Brad.
I have fixed length o/p seq file,so I need to specify NULL values for every field in case I encounter nulls. In my case I want to populate spaces if the incoming value is null.So if I have a field of 100 bytes length do I need to specify 100 spaces or is there any other way which can fill spaces equal to the length of the field without me giving 100 spaces??
nynali
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have to supply 100 characters.

That is an absolute requirement - you are using a fixed width field that is 100 characters wide. You must provide precisely 100 characters.

There is no "lazy way".

Please don't confuse bytes and characters. It is not always the case that one byte = one character.
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