Default non-nullable value for a Lookup Stage

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
droberts
Premium Member
Premium Member
Posts: 38
Joined: Wed Apr 01, 2009 4:34 am
Location: UK

Default non-nullable value for a Lookup Stage

Post by droberts »

Hi,

I am performing a lookup using a lookup stage and potentially, the values being looked up may not exist, which is fine.

I have set the stage to CONTINUE if the Lookup fails but the default value for the BIGINT field, which would have been derived from the lookup dataset, is being set to 0 (the lookup field is non-nullable) in the output.

Is there any way I can over-ride this default value in the stage itself - the manual does not offer any guidance and I cannot see any posts related to this topic. I want to set the value to -1 if the lookup fails.

If not, can a Modify stage after the lookup alter a value from 0 to -1 - again, the manual implies not. I could use a Transformer but wanted to implement a more efficient solution.

Or perhaps, is there an environment variable I can set to set a default non-nullable BIGINT to -1?

Many Thanks,

Daren
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

Hi Daren,

I think you're stuck with it as is in this scenario, by nature of the lookup stage. It's not built for any modification of the data or otherwise, so any defaulting you'd want to do would need to come in a step after.

Cheers,

Mark
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
droberts
Premium Member
Premium Member
Posts: 38
Joined: Wed Apr 01, 2009 4:34 am
Location: UK

Post by droberts »

Hi,

Thanks, that's what I thought but thought i might as well ask :)

Daren
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

Absolutely, that's the nature of the beast :)
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
Post Reply