Lookup Stage - Problem

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Lookup Stage - Problem

Post by Raftsman »

I am getting the following error and I am not sure why:

Look_Code: Error when checking operator: Key field "SYS_APLC_NM" not found in input schema

I joined two DB2 tables and then used the modify stage to remove spaces from the SYS_APLC_NM field. I can't understand why the lookup stage can't find my field.

Could someone please explain why.

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

Post by ray.wurlod »

What's the data type? You can't effectively Trim() a Char data type; it is immediately padded to length. You probably need to effect the lookup using VarChar data type on both inputs, or identically padded Char. You also need to ensure that the inputs are identicatlly partitioned or that the reference input is Entire partitioned.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

It is a VarChar datatype
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Have DataStage dump the actual schemas that were used. Set the OSH_PRINT_SCHEMAS environment variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

I set the environment variable to TRUE but I am not sure how to dump the schemas. Could you please let me know. thanks
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

Question: Can you not use to different field names to make the lookup.

i.e. SYS_APLC_NM = Table.CD


The SYS_APLC_NM will match the Table Code
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

Raftsman wrote:Question: Can you not use to different field names to make the lookup.

i.e. SYS_APLC_NM = Table.CD


The SYS_APLC_NM will match the Table Code
Hi,
If it is a 7.5.1, then you can use the column name differently, because where we have to drage the link to match the column names. But, what I am thinking is the column name is not properly handled in modify stage. your synatx to handle null in the modify stage will be

New column = handle_null(' ',Old column nme).

Check it once.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Whether or not you can use a different name and perform key column matching depends on what's feeding the reference input link to the Lookup stage. If it's a Lookup File Set stage or a sparse lookup then the answer is no.
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