Strange question about lookup hased file

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
Geppo
Participant
Posts: 19
Joined: Wed Feb 05, 2003 5:25 am
Location: NAPOLI (Italy)

Strange question about lookup hased file

Post by Geppo »

Hi everyone,
we are finding a solution for the following problem:

we are using DataStage 5.1

we have a lookup on a target table with an hashed file.

We'd like to insert a record in the target table and we want that this record is immediatly visible (stored) in the lookup hashed file.
In this way if the second record have the same key value of the record already loaded, we can update it.
I know that there is a lot of way to do this without hashed file but unfortunatelly we are obliged to do it in this way

Thank you, in advance.
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Hi Geppo,

don't mind this is a method, which makes sense and is often used. You have to pay attention, that your Lookup-Hash-File is not stored in Memory so you have your updates at once.

Wolfgang
Hi everyone,
we are finding a solution for the following problem:

we are using DataStage 5.1

we have a lookup on a target table with an hashed file.

We'd like to insert a record in the target table and we want that this record is immediatly visible (stored) in the lookup hashed file.
In this way if the second record have the same key value of the record already loaded, we can update it.
I know that there is a lot of way to do this without hashed file but unfortunatelly we are obliged to do it in this way

Thank you, in advance.

Geppo
Participant
Posts: 19
Joined: Wed Feb 05, 2003 5:25 am
Location: NAPOLI (Italy)

Post by Geppo »

Hi Wolfgang,
sorry but we don't understan what you mean.
We try to set "Disabled" (and "Disabled, Lock for Updates") the "Pre-load file to memory" menu in the "outputs" of hashed file but it doesn't works!

We're right?

Thank you

Geppo

Hi Geppo,

don't mind this is a method, which makes sense and is often used. You have to pay attention, that your Lookup-Hash-File is not stored in Memory so you have your updates at once.

Wolfgang
Hi everyone,
we are finding a solution for the following problem:

we are using DataStage 5.1

we have a lookup on a target table with an hashed file.

We'd like to insert a record in the target table and we want that this record is immediatly visible (stored) in the lookup hashed file.
In this way if the second record have the same key value of the record already loaded, we can update it.
I know that there is a lot of way to do this without hashed file but unfortunatelly we are obliged to do it in this way

Thank you, in advance.

JeanPierreHaddad
Participant
Posts: 18
Joined: Mon Nov 25, 2002 3:23 am
Location: Switzerland

Post by JeanPierreHaddad »

You must also disable the write cache in the input hash-file.
In this case the records will be written onto the file immediately after being created/processed and therefore immediately available for the look-up.
constc
Participant
Posts: 4
Joined: Sun Dec 15, 2002 7:03 pm

Post by constc »

The method that I have used is as the follow (see diagram):

..............................HashFile2
.................................|
.................................V
Input->Tranformer1->Transformer2->Target
.............|...................|
.............V...................V
..........HashFile1............HashFile3

Note:
1. All three hashfiles are pointing to the SAME hash file, i.e. have the same hash file name.
2. Hshfile1 is just a dummy to create the hash file on first runtime. Without it, the job will fail as it would not be able to find HashFile2 in the lookup.
3. Hashfile2 is to perform lookup to see if the file is already in the targetDB. If not exist, then load into target DB as well as HashFile3
4. When the next record comes in, as the Hashfile 2 and Hashfile3 are the same, previous records would be in the file already.
5. Remember to select "clear file before writing" on the Hashfile3. And, don't use cache or memory for lookup or updates.

I hope this helps.

constc


Edited by - constc on 11/28/2002 20:06:31

Edited by - constc on 11/28/2002 20:07:05
Post Reply