Page 1 of 1

UtilityHashLookup calling

Posted: Fri Oct 21, 2005 6:23 am
by Veni
Hi All,

when i am calling UtilityHashLookup function in my routine , it alwas return space ... my code is

Deffun UtilityHashLookup(A1,A2,A3) Calling "DSX.UTILITYHASHLOOKUP"
RowNumber = UtilityHashLookup("AccountTest",449100,0)
Ans=RowNumber


Account no 449100 is exit in AccountTest Hashfile but when i run this code i am getting null only.

AccountTest hashfile is having only one field called Account this is a key field of hashfile.

Can any help me ?

Posted: Fri Oct 21, 2005 6:31 am
by kduke
Null means it does not exist. What do you want it to do?

You can copy this routine and make your own version and return @TRUE if found or @FALSE if not.

re

Posted: Fri Oct 21, 2005 7:06 am
by Veni
kduke wrote:Null means it does not exist. What do you want it to do?

You can copy this routine and make your own version and return @TRUE if found or @FALSE if not.

Hi ,

AccountTest hash table is having 449100 value., when i run the routine it is saying null....! i am not able to understand... how to pass arg in UtilityHashLookup , function.

see my hashfile is having only one column Account this key field for AccountTest hashfile, i am search 449100 value is exits in hashfile or not.

now tell me where i am doing mistake

Posted: Fri Oct 21, 2005 7:10 am
by chulett
Is your hashed file in an 'account' or is it a 'pathed' hashed file? This utility will only work with account based hashed files, hence the question.

reply

Posted: Fri Oct 21, 2005 7:36 am
by Veni
chulett wrote:Is your hashed file in an 'account' or is it a 'pathed' hashed file? This utility will only work with account based hashed files, hence the question.
This account based hashed files

Posted: Sat Oct 22, 2005 10:25 am
by kduke
It will not search for something. It will only read something if you give it a key value and either key exists or it does not exist.

Why are you using this instead of a hash file lookup?

Posted: Sat Oct 22, 2005 4:30 pm
by ray.wurlod
When you are performing a lookup in DataStage, whether from this routine or from a Transformer stage, failing to find the key value will result in each column on the reference input link being set to NULL. In this it behaves in exactly the same way as does a left outer join in SQL, it guarantees that the source row propagates, and NULL indicates that the sought key value was not found.

Posted: Mon Oct 24, 2005 1:24 am
by loveojha2
Its is not returning Null, it is just telling you the contents of the record keyed by 449100 and since you don't have anything in the record it is telling you nothing.

To understand it, use a Hased file which is having columns other than the key column and you will understand what is it doing? :wink: (It will show you the whole record).

Hope this will help you.

Posted: Mon Oct 24, 2005 1:40 am
by Veni
"
loveojha2 wrote:Its is not returning Null, it is just telling you the contents of the record keyed by 449100 and since you don't have anything in the record it is telling you nothing.

To understand it, use a Hased file which is having columns other than the key column and you will understand what is it doing? :wink: (It will show you the whole record).

Hope this will help you.
"

Now i am having two column in hashfile one is key column (account) another column is AccountName....!

now also it return record not found.

Posted: Mon Oct 24, 2005 2:28 am
by loveojha2
Veni wrote:"
loveojha2 wrote:Its is not returning Null, it is just telling you the contents of the record keyed by 449100 and since you don't have anything in the record it is telling you nothing.

To understand it, use a Hased file which is having columns other than the key column and you will understand what is it doing? :wink: (It will show you the whole record).

Hope this will help you.
"

Now i am having two column in hashfile one is key column (account) another column is AccountName....!

now also it return record not found.
This means the record is not there, nothing else.
(after running the routine double click the Results cell, you should see the record there)

Posted: Wed Oct 26, 2005 7:31 am
by Veni
loveojha2 wrote:
Veni wrote:"
loveojha2 wrote:Its is not returning Null, it is just telling you the contents of the record keyed by 449100 and since you don't have anything in the record it is telling you nothing.

To understand it, use a Hased file which is having columns other than the key column and you will understand what is it doing? :wink: (It will show you the whole record).

Hope this will help you.
"

Now i am having two column in hashfile one is key column (account) another column is AccountName....!

now also it return record not found.
This means the record is not there, nothing else.
(after running the routine double click the Results cell, you should see the record there)

Thanks for all of you, i got the answer.. and my problem was solved