Lookup retruns 0 instead of null for records not found

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
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Lookup retruns 0 instead of null for records not found

Post by Marley777 »

Hi, thanks for reading.

Have a job that calls a shared container. The shared container performs a common lookup. The shared container is using RCP so on the input link we only define metadata for fields needed in the lookup...everything else passes through via rcp. Everything works, as far as the rcp and lookup, but when the lookup fails we get 0 in our integer field and 01-01-0001 in our two date fields. These are fields that we are expected to get from the reference link, but are expecting nulls when there is not a match. Seems to be defaulting...anyone know what I can change to get nulls in fields when a match isn't found?
rcanaran
Premium Member
Premium Member
Posts: 64
Joined: Wed Jun 14, 2006 3:51 pm
Location: CANADA

Post by rcanaran »

In the metadata for the lookup, try setting the columns to be nullable, both on inut to the lookup stage and on output from the lookup stage.
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Post by Marley777 »

That worked...thanks for your help rcanaran.
Post Reply