Lookup if then else in EE edition??

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
roosenr
Premium Member
Premium Member
Posts: 15
Joined: Thu Jan 16, 2003 2:33 am

Lookup if then else in EE edition??

Post by roosenr »

In server edition its very easy to do a lookup in a transformer stage like this:

A is sourcecolumn
B is column to match with A in lookuptable
D is lookupcolumn that is given to outpttable as C when lookup is found
C is the outputcolumn

now if A=B then D is given to C
but if A <> B then A is given to C

this logic is written in the derivation of outputcolumn C (if IsNull(lookup.D) then source.A else lookup.D)

in lookupstage in EE edition i dont find the way to do this...?

can anybody explain to me? Probably will be very easy 2...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Use the lookup stage to join the column, then use a transform stage in the same manne as before to perform your logic. The only difference is that in PX the lookup portion is done in another stage.
roosenr
Premium Member
Premium Member
Posts: 15
Joined: Thu Jan 16, 2003 2:33 am

Post by roosenr »

or use the reject link from the lookup stage and funnel them both together afterwords?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You don't need a separate reject link; the lookup will return null values for the lookup columns or set a return variable (I cannot recall the name, but you can look that up) to determine if the lookup was successful or not.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just set your Lookup Failed rule to Continue, propagate column A to the output as well, and check downstream in a Transformer stage whether C is null - if so use A otherwise use C.
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