Range Lookup Strange Behavior
Moderators: chulett, rschirm, roy
Range Lookup Strange Behavior
I have the following data in the Lookup file.
Code varChar 5
Name varChar 20
the Data in the look up file is as .
00120 Sreedhar
0120 Molgara
Data some from the input is
0120 when the lookup is done I have getting Sreedhar as output. Instead of Molgara
Can some one help me what is that I am doing wrong.
Thanks
SM
Code varChar 5
Name varChar 20
the Data in the look up file is as .
00120 Sreedhar
0120 Molgara
Data some from the input is
0120 when the lookup is done I have getting Sreedhar as output. Instead of Molgara
Can some one help me what is that I am doing wrong.
Thanks
SM
Regards,
Shree
785-816-0728
Shree
785-816-0728
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Can you identify both boundary values for the range? For example if the lower bound is 0120 but the upper bound is 999999 then it is possible that 00120 might be the first or last key found and that then the row that is returned from the reference input.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
The Range is as followray.wurlod wrote:Can you identify both boundary values for the range? For example if the lower bound is 0120 but the upper bound is 999999 then it is possible that 00120 might be the first or last key found and that ...
0120 - 0200 Molgara
00120- 01999 Sreedhar
Regards,
SM
Regards,
Shree
785-816-0728
Shree
785-816-0728
Sreedhar wrote:The Range is as followray.wurlod wrote:Can you identify both boundary values for the range? For example if the lower bound is 0120 but the upper bound is 999999 then it is possible that 00120 might be the first or last key found and that ...
Defination :
Code_from Char 5
Code_to Char 5
Name Varchar 20
the Data in the look up file is as .
0120 - 0200 Molgara
00120- 01999 Sreedhar
Data some from the input is
0120 (varchar 10 I am doing a Trim on this) when the lookup is done I am getting Sreedhar as output. Instead of Molgara
Can some one help me what is that I am doing wrong.
Regards,
SM
Regards,
Shree
785-816-0728
Shree
785-816-0728
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I don't know that is the a root cause. Bez I have some other values I am getting the right output.
namely
0120 - 0200 Molgara
0250-0260 NewInput
00120- 01999 Sreedhar
When I send the input as 0252 I get NewInput, but the problem come only with 0120 or 0121 where insted of Molgara I am getting Sreedhar. don't know what's going wrong.
Regards,
namely
0120 - 0200 Molgara
0250-0260 NewInput
00120- 01999 Sreedhar
When I send the input as 0252 I get NewInput, but the problem come only with 0120 or 0121 where insted of Molgara I am getting Sreedhar. don't know what's going wrong.
Regards,
Regards,
Shree
785-816-0728
Shree
785-816-0728
I am sorry If I have confused you.
The lookup file is like this.
Code_from Code_to Name
0120 0200 Molgara
0250 0260 NewInput
00120 01999 Sreedhar
I didn't sort while loading into the Lookup file set.
Should I be sorting it before I load into the Lookup file set?
as said above based on input
"When I send the input as 0252 I get NewInput, but the problem come only with 0120 or 0121 where insted of Molgara I am getting Sreedhar. don't know what's going wrong.
"
Let me know if more info is needed.
The lookup file is like this.
Code_from Code_to Name
0120 0200 Molgara
0250 0260 NewInput
00120 01999 Sreedhar
I didn't sort while loading into the Lookup file set.
Should I be sorting it before I load into the Lookup file set?
as said above based on input
"When I send the input as 0252 I get NewInput, but the problem come only with 0120 or 0121 where insted of Molgara I am getting Sreedhar. don't know what's going wrong.
"
Let me know if more info is needed.
Regards,
Shree
785-816-0728
Shree
785-816-0728
Sorry, but I'm not the one that is confused here.
I wasn't suggesting that you sort or needed to sort anything, *I* sorted your range values to illustrate your problem and to reinforce Ray's comment of "Give some thought to how...". These are string values so the "ranges" are not quite a straight-forward as you seem to think they should be. The sorted output I posted shows how your ranges overlap.
![Wink :wink:](./images/smilies/icon_wink.gif)
I wasn't suggesting that you sort or needed to sort anything, *I* sorted your range values to illustrate your problem and to reinforce Ray's comment of "Give some thought to how...". These are string values so the "ranges" are not quite a straight-forward as you seem to think they should be. The sorted output I posted shows how your ranges overlap.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers