Is it possible to use a hash table to do a glossary look-up?

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Is it possible to use a hash table to do a glossary look-up?

Post by admin »

I have a list of words in a hash table which id like to lookup against an incoming field from a flat file (the field may contain zero to many occurances of a word in the hash table).

Is it possible to do this within the datastage job by defining the hash table as a reference link and putting some sort of expression in the link between the hash table and the incoming file (if so, how would i specify this lookup) or will I need to write a routine to do this (how do i open a hash table and perform a lookup from within a routine)

thanks, Ian


This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, you must
not disclose, copy or take any action in reliance of this transmission.

Although this message and its contents have been scanned for viruses and no
viruses were detected, no responsibility whatsoever is accepted by the
Company, or any of its offices or companies for any loss or damage
arising in any way from receipt or use thereof.

If you have received this email in error please delete this message and notify the Polk System Administrator at postmaster@polkglobal.com.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Yes it is. Essentially you need to break the field of N words (N >= 0) into N rows, for example using a pivot stage, before processing via the reference link. What do you want to get out?

An alternative (which kinda requires a little knowledge of dynamic array processing and DataStage engine operation) is to use the expression: Trim(Convert(@VM," ",Trans(hashedfile,Convert("
",@VM,Trim(wordfield)),0,"X")))
This will return a space-separated string of the words that are in the hashed file.

-----Original Message-----
From: Mason, Ian [mailto:IAN.MASON@POLK.CO.UK]
Sent: Tuesday, 02 October 2001 23:37
To: datastage-users@oliver.com
Subject: Is it possible to use a hash table to do a glossary look-up?



I have a list of words in a hash table which id like to lookup against an incoming field from a flat file (the field may contain zero to many occurances of a word in the hash table).

Is it possible to do this within the datastage job by defining the hash table as a reference link and putting some sort of expression in the link between the hash table and the incoming file (if so, how would i specify this lookup) or will I need to write a routine to do this (how do i open a hash table and perform a lookup from within a routine)

thanks, Ian


This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this transmission.

Although this message and its contents have been scanned for viruses and no viruses were detected, no responsibility whatsoever is accepted by the Company, or any of its offices or companies for any loss or damage arising in any way from receipt or use thereof.

If you have received this email in error please delete this message and notify the Polk System Administrator at postmaster@polkglobal.com.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Hi Ian,
if you are talking about "coursor look-up", you can read the hash file as UV table. In that way,for each records in the tream link, you can "scroll" all records in the reference link.

Regards,
Riccardo

----- Original Message -----
From: "Mason, Ian"
To:
Sent: Tuesday, October 02, 2001 3:37 PM
Subject: Is it possible to use a hash table to do a glossary look-up?


>
> I have a list of words in a hash table which id like to lookup
> against an incoming field from a flat file (the field may contain zero
> to many occurances of a word in the hash table).
>
> Is it possible to do this within the datastage job by defining the
> hash table as a reference link and putting some sort of expression in
> the link between the hash table and the incoming file (if so, how
> would i specify this lookup) or will I need to write a routine to do
> this (how do i open a hash table and perform a lookup from within a
> routine)
>
> thanks, Ian
>
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you are not the intended addressee, you must not
> disclose, copy or take any action in reliance of this transmission.
>
> Although this message and its contents have been scanned for viruses
> and
no
> viruses were detected, no responsibility whatsoever is accepted by the
> Company, or any of its offices or companies for any loss or damage
> arising in any way from receipt or use thereof.
>
> If you have received this email in error please delete this message
> and notify the Polk System Administrator at postmaster@polkglobal.com.
>
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

thanks all, ive adapted one of the routines provided in the sdk for hash table lookups and have even managed to maintain a decent throughput

-----Original Message-----
From: Riccardo Tani [mailto:rtani@datamat.it]
Sent: Wednesday, October 03, 2001 18:07
To: datastage-users@oliver.com
Subject: Re: Is it possible to use a hash table to do a glossary look-up?


Hi Ian,
if you are talking about "coursor look-up", you can read the hash file as UV table. In that way,for each records in the tream link, you can "scroll" all records in the reference link.

Regards,
Riccardo

----- Original Message -----
From: "Mason, Ian"
To:
Sent: Tuesday, October 02, 2001 3:37 PM
Subject: Is it possible to use a hash table to do a glossary look-up?


>
> I have a list of words in a hash table which id like to lookup
> against an incoming field from a flat file (the field may contain zero
> to many occurances of a word in the hash table).
>
> Is it possible to do this within the datastage job by defining the
> hash table as a reference link and putting some sort of expression in
> the link between the hash table and the incoming file (if so, how
> would i specify this lookup) or will I need to write a routine to do
> this (how do i open a hash table and perform a lookup from within a
> routine)
>
> thanks, Ian
>
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you are not the intended addressee, you must not
> disclose, copy or take any action in reliance of this transmission.
>
> Although this message and its contents have been scanned for viruses
> and
no
> viruses were detected, no responsibility whatsoever is accepted by the
> Company, or any of its offices or companies for any loss or damage
> arising in any way from receipt or use thereof.
>
> If you have received this email in error please delete this message
> and notify the Polk System Administrator at postmaster@polkglobal.com.
>
Locked