Page 1 of 1

Lookup Stage - Problem

Posted: Wed Nov 15, 2006 8:25 am
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

Posted: Wed Nov 15, 2006 9:26 am
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.

Posted: Wed Nov 15, 2006 10:09 am
by Raftsman
It is a VarChar datatype

Posted: Wed Nov 15, 2006 10:53 am
by ray.wurlod
Have DataStage dump the actual schemas that were used. Set the OSH_PRINT_SCHEMAS environment variable.

Posted: Wed Nov 15, 2006 11:04 am
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

Posted: Wed Nov 15, 2006 12:42 pm
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

Posted: Mon Nov 20, 2006 4:09 am
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.

Posted: Mon Nov 20, 2006 7:35 am
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.