Page 1 of 1

Lookup in DS MVS Edition

Posted: Thu Jun 29, 2006 10:18 am
by rupeshg
Hi,

I have a senario, where I have to lookup 2 columns from table A with a single lookup table LK and get their corresponding values from that table. But as far as I know lookup can be done only on one value and not more than one. For example, my input table is

Column Value
----------------
lobcd BBB
trncd LLL


look up tables is

Column Value1 Value2
--------------------------
lobcd AAA XXX
lobcd BBB YYY
trncd CCC ZZZ
trncd LLL MMM


and the expected output from my look up is as follows

Column Value
----------------
lobcd YYY
trncd MMM


I am trying to look up based on the column name and the values in it and trying to get the corresponding output.

Could anyone please comment on whether this can be achieved by one look up or do i need to use lookup stage twice? Your feedback on this would be helpful. Thanks.

Regards,
Rupesh

Posted: Thu Jun 29, 2006 3:22 pm
by ray.wurlod
You should be able to lookup on more than one column. However, you may have to "lie" that they are all "Key" columns on the link connecting to the reference input. That is, in your case, declare both columns to be key columns.