Null Value for Integer

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
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Null Value for Integer

Post by Havoc »

Hi,

Is there anyway to set the null value for an integer column which is an unmatched row from the update link of a Merge stage(in Keep Mode)? As of now , all integer columns of unmatched rows are set to 0. Is there a way to set this to some other value?

Thanks in advance :)
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Check the nullability on this integer field. If yes then it would give a NULL value
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Post by Havoc »

Yeah it is a non nullable column. But can I set this null default value to something else? I would like to set the integer value to something other than the DataStage default 0.

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

Post by ray.wurlod »

Code: Select all

NonNullField : int32 = handle_null(InputField, 42)
Forty two is the ultimate answer to life, the universe and everything.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Post by Havoc »

ray.wurlod wrote:

Code: Select all

NonNullField : int32 = handle_null(InputField, 42)
Forty two is the ultimate answer to life, the universe and everything. ...
Hmmm ...I would greatly appreciate it if you could elaborate a lil bit more on this Ray.. (not on the The Hitchhiker's Guide to the Galaxy bit ;) )

Can i incorporate this in a transformer instead? Basically the job design has a transformer following the merge stage. Is there a way I can go about setting the transformer constraint or if-else rule to check for a value like -3 instead of 0, cause there is a possibility that 0 might actually be a valid value.

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

Post by ray.wurlod »

In a Transformer stage the equivalent function is NullToValue(). When the lookup fails and the rule is Continue, you get a genuine NULL on the output. If the field is non-nullable you also get a warning, and that field will take its default value, which you can set (for example to -3) in the metadata. Otherwise, make the field nullable and handle the NULL in the downstream Transformer stage.
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