hash lookup in a range

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
acool
Participant
Posts: 29
Joined: Tue Feb 17, 2004 4:31 pm

hash lookup in a range

Post by acool »

Hi everybody,

I want to have a special hash lookup, in stead of matching the key, I will math the key within a range, that is, if the input file's key equals the key in the lookup hasfile, or if the input files' key - a key in the lookup file <3, then match.

How can I do it?
KeithM
Participant
Posts: 61
Joined: Thu Apr 22, 2004 11:34 am
Contact:

Post by KeithM »

You can only use a hash file stage to do an equal lookup. To do a range lookup you would have to use a different stage like an ODBC stage or the UV stage. You will have to change the SQL to be user-defined and then replace the equal join generated with a greater than/less than join to fit your needs.
Keith
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you can "math the range" down to a constant for each possible range, then you can look up this constant as the key value in the hashed file.

If you can't, then you can't.

Contemplate how you might build the math, and therefore how you might populate the hashed file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

You may have to resort to writing a looping hash lookup routine if you can, as Ray suggested, "math the range" not necessarily to a single value, but at least to a predictable list of values.

You are creating a potential I/O bottleneck, but what are ETL tools for?

Look at the sdk / Utility / UtilityHashLookup routine.
Post Reply