Page 1 of 1

Range Lookup

Posted: Mon Jul 19, 2004 3:39 pm
by yiminghu
Hi,

I have a question regarding Range Lookup. I have an input file which has a field called salary, I need to reference a table to find salary range key based on salary figure. The salary range table contains salary_range_key, min_salary, max_salary. Is it possilbe to use hash file to implment this change ?

Thanks,

Yiming

Posted: Mon Jul 19, 2004 5:13 pm
by kduke
You have to switch it to a UV stage instead of a hash file stage. Pick the columns you want the range on as key fields then switch to a user defined query and make it a between instead of a exact match.

Posted: Tue Jul 20, 2004 5:57 am
by ray.wurlod
Yes, you lie to DataStage about which columns are "key" (arguably you ARE using them as secondary keys).
For performance, it is valuable to create an index on each such column.

Posted: Tue Jul 20, 2004 8:00 am
by yiminghu
Hi,

Thanks for the answer. Now I'm having question about how to setup UV stage, according to help manual, the data source name should be set up in uvodbc.config file. How to setup in the file? How to link my hash with this data source name?

Can you shed some lights?

Thanks,

Carol

Posted: Tue Jul 20, 2004 8:27 am
by kduke
It should come setup. A UV stage is using a hash file within Universe only it accesses it using SQL and not the normal method. It is a little slower but more flexible.

Posted: Wed Jul 21, 2004 5:47 am
by ray.wurlod
Use the pre-configured localuv data source.

User ID and password will be disabled, as you're already logged in to that data source.