Lookup condition

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
today
Participant
Posts: 24
Joined: Wed Jan 14, 2009 9:59 pm

Lookup condition

Post by today »

Hi,
I have tried various logocs,but all in vein.I am sure one of you gurus can really help me out.

I want to implement a lookup in the transformer,which if met, should not bring that rows in the hashed file.


IsNull(lkp_CRC.CRC) or CRC <> lkp_CRC.CRC
OR
IsNull(lkp_CRC1.CRC) or CRC <> lkp_CRC1.CRC

I also tried

IsNull(lkp_CRC.CRC) or CRC or IsNull(lkp_CRC1.CRC) <> lkp_CRC.CRC or lkp_CRC1.CRC

Am i doing something wrong?

When I use just one condition its working fine , but not with both conditions on.

Please help

Thanks in advance.
today
Participant
Posts: 24
Joined: Wed Jan 14, 2009 9:59 pm

Re: Lookup condition

Post by today »

I am trying to implement this in constraint
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your first syntax is fine unless both sides could be null. Simpler to use the NullToEmpty() transform, perhaps on both sides:

NullToEmpty(lkp_CRC.CRC) <> NullToEmpty(CRC)
-craig

"You can never have too many knives" -- Logan Nine Fingers
today
Participant
Posts: 24
Joined: Wed Jan 14, 2009 9:59 pm

Post by today »

I tried

NullToEmpty(lkp_CRC.CRC) or NullToEmpty(CRC) <> NullToEmpty(lkp_CRC.CRC)
OR
NullToEmpty(lkp_CRC1.CRC) or NullToEmpty(CRC) <> NullToEmpty(lkp_CRC1.CRC)

but its not working too
JRodriguez
Premium Member
Premium Member
Posts: 425
Joined: Sat Nov 19, 2005 9:26 am
Location: New York City
Contact:

Post by JRodriguez »

(
IsNull(lkp_CRC.CRC) or ( NullToEmpty(CRC) <> NullToEmpty (lkp_CRC.CRC) )
)

OR
(
IsNull(lkp_CRC1.CRC) or (NullToEmpty(CRC) <> NullToEmpty(lkp_CRC1.CRC) )

)
Julio Rodriguez
ETL Developer by choice

"Sure we have lots of reasons for being rude - But no excuses
today
Participant
Posts: 24
Joined: Wed Jan 14, 2009 9:59 pm

Post by today »

It worked just fine :)

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

Post by chulett »

Just for the record, you don't need the extra "IsNull" check with the NullToEmpty transform on both sides.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply