Lookup Stage Condition!

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
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Lookup Stage Condition!

Post by ds2000 »

Hi,

I have PX job and want to lookup with areacode and xchngcode if found then send to target, if not found then lookup with areacode and xchngcode with wildcard (***) instead of actual xchngcode. e.g
areacode= 631
xchngcode= 514 (if not found then lookup with *** instead of 514).

Thanks in advance.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

In the reject link of the look up stage specify one more look up with wildcard.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What precisely do you mean by "lookup with wildcard"? The explicit value "***"? Or all possible area codes? The latter isn't possible with a Lookup stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Explicit Value of *** in lookup

Post by ds2000 »

Hi Ray,
I want Explicit Value of *** in 2nd lookup.

Hi Josh,
I dont want to use reject anyother option ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use Continue on the first, make the second lookup conditional on one of the returned columns from the first being NULL, and use Drop on the second. Or use Continue on the second and filter out the NULLs downstream if you need to count them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

Ray,
Would you explain it in detail plz.
do i have to do lookup and then output to transformer to use the condition?
how would i use *** value there ?
can i use 2/3 lookups at the same time, what would be order of execution. first row would be checked for each lookup.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Give "Lookup Failure" condition as continue in both the look up stages. After the first look up, check for NULL in your look up result field and if that is true substitute it to '***' and do the look up in the second one.

Alternatively you can design your job with reject link for the first look up stage and then do the second look up with wildcard and finally join all the records using funnel stage.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Post by vijayrc »

JoshGeorge wrote:Give "Lookup Failure" condition as continue in both the look up stages. After the first look up, check for NULL in your look up result field and if that is true substitute it to '***' and do the look up in the second one.

Alternatively you can design your job with reject link for the first look up stage and then do the second look up with wildcard and finally join all the records using funnel stage.
You can have the second reference data link on the same lookup with just areacode as key to the input and thereby xchange can be skipped.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Re: Lookup Stage Condition!

Post by JoshGeorge »

OP posted in PX forum under server section saying he is using a PX job :lol:
vijayrc wrote:You can have the second reference data link on the same lookup with just areacode as key to the input and thereby xchange can be skipped
ds2000 wrote:I have PX job
ds2000 wrote:I want Explicit Value of *** in 2nd lookup
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Post Reply