Lookup - Selective Records; Other Continue

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
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Lookup - Selective Records; Other Continue

Post by vijayrc »

Hello,
I have a scenario, wherein I have a
Dataset==>Transformer==>Lookup==>Dataset

There's one set of records [Input Field1=00]in Input wherein it wouldn't find a Lookup in the Reference, and it should just pass the entire Input record to the Output. For the rest of the records [Input Field1 <> 00], Do a lookup and derive some values..

How do I selectively put a Constraint for this case.
Thanks
Vijay
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can have a reject link coming out of the Lookup Stage that will carry records which will fail the lookup. Send both the inputs (lookup successful and lookup failure which is the reject link) to a funnel stage. The output of funnel stage can go to your final dataset.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Post by vijayrc »

DSguru2B wrote:You can have a reject link coming out of the Lookup Stage that will carry records which will fail the lookup. Send both the inputs (lookup successful and lookup failure which is the reject link) to a funnel stage. The output of funnel stage can go to your final dataset.
Thanks for the suggestion. I had that in mind, but I want to see if there's a way w/o using any additional stage to accomplish this
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I hardly doubt it as you cannot constraint any input inside the lookup stage. You will have to either seperate it in the transformer and then collect it later or go with the other method I advised.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Lookup stage has its own "Constraints" area - click on the second tool from the left in its toolbar.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Post by vijayrc »

ray.wurlod wrote:The Lookup stage has its own "Constraints" area - click on the second tool from the left in its toolbar. ...
Ray,
The Constraints list the reference link and the derivation bar for the constraint doesn't allow me to select any Input Column. Thanks again for all the inputs.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

If you have the right version of DataStage, I think it's the latest Unix/Linux version but not the Windows version, you can do a conditional lookup using the parallel lookup stage. The constraints form lets you enter a condition on whether the lookup should be performed for each row using values in the input link.

This lets you skip the lookup for rows that meet the criteria.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Even version 7.5x2 (Windows) permits conditional lookups.
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