PX Ochestrate Lookup

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dtatem
Participant
Posts: 54
Joined: Wed Jun 09, 2004 7:50 am

PX Ochestrate Lookup

Post by dtatem »

From an input source file, have 5 columns that are key columns plus a starting range value. I am attempting to perform a Sparse DB2 lookup using the columns above...the job fails with An input record has no lookup match. Now if I make the necessary changes and submit into DB2, the query works. Am I missing something? Thanks in Advance

Here is the DB2 sparse query:
SELECT
PRC_AMT
FROM
SCHEMA.AMT_PRC_TBL
WHERE
(C1 = ORCHESTRATE.C1
AND C2 = ORCHESTRATE.C2
AND C3 = ORCHESTRATE.C3
AND C4 = ORCHESTRATE.C4
AND C5 = ORCHESTRATE.C5) AND (ORCHESTRATE.AMT BETWEEN STR_RNG and END_RNGE_NBR)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is your "lookup failed" rule in the Lookup stage? By default it's set to Fail, which causes your job to abort on the first occasion a lookup fails to return a row.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dtatem
Participant
Posts: 54
Joined: Wed Jun 09, 2004 7:50 am

Post by dtatem »

Thanks for replying... The default is set to Fail, I changed it to "Continue" but it runs OK doesnot fail, but all of my results from the Lookup is "NULL"

If I take the SQL and substitute values and run in DB2 I get results.

How should I declare columns C1 - C5? Do I define them as key columns in DataStage. These columns are what are in my source data and they are also in the DB2 table. The AMT value is in my source also

Thanks..

dtatem
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need to declare them as Key on the DB2 link. "Key" in this context means "lookup key" rather than "primary key".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dtatem
Participant
Posts: 54
Joined: Wed Jun 09, 2004 7:50 am

Post by dtatem »

Ray:

Thanks for replying.
My columns C1-C5 are declared as "Key" for lookup keys and I am still getting the same results ."job fails with An input record has no lookup match"
Any other ideas and/or suggestions?

Thanks

dtatem
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

You might want to format/trim the input link data before look up.
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 »

The variants on the "lookup failed" rule indicate that you are getting no matches. The Continue rule mimics a left outer join, hence the returned NULL fields.

Can you execute this query successfully outside of DataStage with appropriate value substitutions?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sanjay
Premium Member
Premium Member
Posts: 203
Joined: Fri Apr 23, 2004 2:22 am

Post by sanjay »

dtatem

Try wiith just C1 in your query i.e.

SELECT
PRC_AMT
FROM
SCHEMA.AMT_PRC_TBL
WHERE
C1 = ORCHESTRATE.C1
see whetther it returns value then GO ON ADDING C2,C3,C4,C5

Sanjay

ray.wurlod wrote:The variants on the "lookup failed" rule indicate that you are getting no matches. The Continue rule mimics a left outer join, hence the returned NULL fields.

Can you execute this query successful ...
Post Reply