Hash Logic

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
rcil
Charter Member
Charter Member
Posts: 70
Joined: Sat Jun 05, 2004 1:37 am

Hash Logic

Post by rcil »

Hello All,

Here I am trying to understand a previous built job. what results do I get when I have two output links with different transformations writing to a single hash file with single key? On what situations do we use this kind of logic?

If we check only the 'Clear File before writing' and uncheck the 'create file' options on the hash file stage, will these options create a hash file? or is it must that 'create file' option should be checked to create hash?

thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Hash Logic

Post by chulett »

rcil wrote:If we check only the 'Clear File before writing' and uncheck the 'create file' options on the hash file stage, will these options create a hash file? or is it must that 'create file' option should be checked to create hash?
Clearing the file before writing has no bearing on whether it gets created or not. Think of it as a 'truncate' for the hash file.

Hash files will get created regardless of whether you have the 'Create File' option checked or not. If it doesn't exist when it goes to write to it, DataStage will create it. What you buy when you enable it is the 'Options' that come along for the ride. If you don't use or change a single option, then don't bother to check the create file box. Once you do, however, you can change the type from its default of 30, increase the Minimum Modulus to 'presize' it, or delete the hash and recreate it every run of the job - amongst other things.
Here I am trying to understand a previous built job. what results do I get when I have two output links with different transformations writing to a single hash file with single key? On what situations do we use this kind of logic?
What do you get? The classic hash file answer - destructive overwrite, so last one in wins. In what situations would you do this? Can't really say, hopefully ones where that makes sense. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

rcil,

in addition to what Craig stated, I would just ask that you make sure that both links are actually writing to the same file. Two links going into the same HASH stage don't mean that they are writing to the same file. I've made that mistake before (more than once). Just food for thought...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Very true! Two links into one stage doesn't mean that they write to the same hash. All it guarantees is they live in the same account or are pathed in the same directory.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply