Has file lookup using less than or rather than

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nibble
Premium Member
Premium Member
Posts: 10
Joined: Mon Feb 06, 2006 7:49 am

Has file lookup using less than or rather than

Post by nibble »

I have a hash file containing three key colums, one of the columns is a number column containing 100, 200, 500 etc. (sorted)
The main input column mapped to the hash file contains numbers between 0 and 1000.
I want to be able to map to the correct column in the hash file using less than or grather than.
Let's say input value is 124.
On the mapping column, I change the input value to a string like this:
>124. The correct row found should be the row with 200 in its key number field.
Because data is sorted, the transformer will find the first row with a key value > 124... Is this possible ?

If I use multiple row lookup using a UniVerse stage, can I select one row from several rows by using less than / grater than or other functions ?

Chris.
Chris
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If you make a search on 'Range lookup' you can get an idea of how to go about this.
One way is you can populate the hash file in such a way that the values are continues, ie., 100 to 200 will point to 200 and 200 to 500 will point 500.
As you say, you can use Universe stage for join query for the range given in condition.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

With a UV stage you can specify whatever SQL you need to do your job; for example, if you sort by the lookup key and don't use multi-row return, you would get the highest value that meet your criteria.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply