Clarification on Range Lookups

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
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Clarification on Range Lookups

Post by Vinodanand »

Hi ,
I used the look up stage with lookup type as Range in 8.x and have the following issue .


Layouts
Source File :Keys.txt

Contents :
Value
1
102

Reference File : Key_range.txt
Contents :
startvalue, endvalue, description
1 , 100 , A
101 ,200 ,B
Expected Output :
Contents :
Value,Description
1,A
2,B

Issue Description :
i) When I had the source,refernece and target columns defined as varchar the range look up did not work,all the records went to the reject link. But when I changed the dataype to Integer for the columns , Value (Source File ), Start & End value ( reference file) I had a hit and got the desired output .

ii) I decided to swap the source and the reference but kept the datatypes as varchar . So my new job had the following as source and reference files :

Source File : Key_range.txt
Reference File : Keys.txt

Now the look up worked and I got the expected result .

Does it mean that we cannot have integer datatype when the range is done on stream link ( i.e. when the source file is like keys.txt)

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

Post by ray.wurlod »

Integer is fine. There are known problems with VarChar when performing range lookups, at least in version 8.0.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

Thanks Ray . But its puzzling that varchar / integer works when the range look up is done on the stream column .

So does it mean that I cannot have alphabet keys when the range is on the reference look up (key_range.txt).

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

Post by ray.wurlod »

It's a known bug, but yes that's how it is at the moment.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

Thanks ray
Post Reply