Null value appeared as '0' for integer 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
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Null value appeared as '0' for integer column

Post by GowthamSen »

Hi,

I created a simple job where I have two sources (defined as sequential file stages), a Join stage ( doing Outer joins) and then loading the final output to a sequential file stage.

Everything works fine. As I am using outer joins I am expecting null values. There is a record where null values should be appeared.

For Varchar fields the null value is appeared as blank. But the null value for Integer variable is appeared as '0' in the file.

Not sure why its coming like this. I am using all default settings for sequential file stage.

Please help me in this.
Thank you,
Regards

Gowtham
(Learning DS)
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

In the default tab of the sequential file 'default null value would have been set to zero'.
You can set this to '' so that null value is stored as 'empty'

Regards
Sreeni
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Post by GowthamSen »

Hi,

Nope, No default value is set. Even I tried this option by manually setting it, its the same.

I believe that, this value is being set as 0 in Join stage. Is there any way we can debug and find out how the data is changing?

As its a parallel job there is no debug option. I am wondering how we can do this in this scenario.?

Thanks a lot!
Thank you,
Regards

Gowtham
(Learning DS)
dougcl
Premium Member
Premium Member
Posts: 137
Joined: Thu Jun 24, 2010 4:28 pm

Post by dougcl »

Make sure the column on your join input and output links says Nullable=Yes.
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

That is the default behavior when going from a nullable input to a not nullable output and the input value is null.

Same in the lookup, merge etc...

Has nothing to do with your sequential stage.
Post Reply