Problem with data lookup job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
aladap12
Participant
Posts: 60
Joined: Fri Jul 20, 2007 1:15 pm
Location: NO

Problem with data lookup job

Post by aladap12 »

All

i have an issue with data conversion in one of my lookup jobs

source file has two fields let us assume A,B
lookup file has three fileds C,d,e

my issues is

I have to send the 'e' to target if 'A' matches to 'C' and 'B' matches to 'D', it does matches then i have to send A to target.

i have defined my logic in transformer, it works good if A,B has values

In my requirement some time B does not contain any value.

and in my reference table we have we hava all the posible entries to A,B

hope you understand my problem

my question is how to do lookup if there is no value in one of the fileds



Krish
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Short answer, you can't. How about you tell us your requirements - what should happen when B is null?
-craig

"You can never have too many knives" -- Logan Nine Fingers
aladap12
Participant
Posts: 60
Joined: Fri Jul 20, 2007 1:15 pm
Location: NO

Thanks for your response

Post by aladap12 »

chulett wrote:Short answer, you can't. How about you tell us your requirements - what should happen when B is null? ...

Chulett


Thanks for your respose.
As i said i have all posible enries to A,B in my reference table

say
A B C
A B1 xxx
A B2 xxx
A xxx

what i has to do is i have to check these fields if both matchs then i have to send C

if i have some thing in A,B then my logic works good.

some time we dont have values from source for 'B'.. then as per my assumption it has to check with A,B in my table and send C

we have all posible entries in my lookup table

Thanks
krish
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You didn't answer my question. What should happen in that case? Then we'll see about implementing it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
aladap12
Participant
Posts: 60
Joined: Fri Jul 20, 2007 1:15 pm
Location: NO

thanks for your reply

Post by aladap12 »

chulett wrote:You didn't answer my question. What should happen in that case? Then we'll see about implementing it. ...
Hi

I got your question now.

i have all posible entries in my look up table

it has A, B with null on it

so it has to match with that and retun the C , But its not doing that if c has null value

'if it is empty it has to match with empty field in the reference table '
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The lookup will work with an 'empty' value, but not with a NULL. For nulls, you'd need to translate that to another unique value (both sides) and use that for the lookup. For example, perhaps '*'. Do the swap in the Key Expression of the lookup.
-craig

"You can never have too many knives" -- Logan Nine Fingers
aladap12
Participant
Posts: 60
Joined: Fri Jul 20, 2007 1:15 pm
Location: NO

Thanks a lot

Post by aladap12 »

chulett wrote:The lookup will work with an 'empty' value, but not with a NULL. For nulls, you'd need to translate that to another unique value (both sides) and use that for the lookup. For example, perhaps '*'. Do ...
Thanks for your Help
Post Reply