Page 1 of 1

LookUp fails

Posted: Wed Mar 30, 2005 3:38 pm
by naren6876
Hi,
In my seqfile One field value is '000'and in my lookuphash file field value is '0'. SO when it is trying to lookup. it will fail.

How to solve this problem.
any help would be appreciated.

TIA

Posted: Wed Mar 30, 2005 3:48 pm
by gpatton
to field in seq file use

(linkname.seq_field_name + 1 - 1)

this will convert it to 0 which will then match with the lookup

Posted: Wed Mar 30, 2005 3:53 pm
by kcbland
gpatton wrote:to field in seq file use

(linkname.seq_field_name + 1 - 1)

this will convert it to 0 which will then match with the lookup
I think you mean in the key expression where you do the lookup use:

Code: Select all

linkname.seq_field_name + 0

Posted: Wed Mar 30, 2005 3:57 pm
by naren6876
Thank you
gpatton wrote:to field in seq file use

(linkname.seq_field_name + 1 - 1)

this will convert it to 0 which will then match with the lookup

Posted: Wed Mar 30, 2005 4:21 pm
by chulett
:!: Note the change Ken made to the key expression logic. Any kind of 'math' on the field will (in essence) convert it to a number. So do something that you know won't change the value of the field - like adding zero to it - rather than adding and subtracting 1 from the value.

Both work and illustrate the point, the zero is 'safer' and fewer operations. :wink: