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?
hash lookup in a range
Moderators: chulett, rschirm, roy
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
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.
You are creating a potential I/O bottleneck, but what are ETL tools for?
Look at the sdk / Utility / UtilityHashLookup routine.
Chuck Smith
www.anotheritco.com
www.anotheritco.com