UtilityHashLookup calling

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
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

UtilityHashLookup calling

Post 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 ?
rv
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

re

Post 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
rv
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

reply

Post 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
rv
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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?
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post 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.
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

Post 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.
rv
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post 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)
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

Post 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
rv
Post Reply