Clearing Hash files

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
swwilbert
Participant
Posts: 6
Joined: Wed Mar 07, 2007 1:37 pm
Location: Cincinnati

Clearing Hash files

Post by swwilbert »

I have a process that has multiple inputs from a single transformer into a hash file. I have set the transformer link ordering. On the first input link into the hash file, I have the hash properties checked: Create File & in options, Delete file. The 2nd & 3rd input, nothing is checked.

I am trying to ensure that the hash file will be cleared by the first link and the 2nd & 3rd will append data to the hash file.

Is this the proper way to go about this? Any one know of a better way?

Thanks in advance

Steve
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

It will work fine as you've described, as long as you don't have any IPC stages between the Transformer and hashed files or inter-process buffering turned on.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... and provided that row #1 is directed to output link #1; not prevented by the constraint expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Abu@0403
Participant
Posts: 32
Joined: Wed Aug 08, 2007 11:21 pm

Re: Clearing Hash files

Post by Abu@0403 »

I think that this is not the way actually the job would work.

Even though link ordering is mentioned in the transformer. Its not like, first all the records of the first link would be loaded into the hash file followed by the second and the third.

Based on the input the loading process would differ.

I think that the link ordering will make sure that the first record from input goes to the first link and then to the next based on link ordering. Similarly the second input would do so in the same manner based on the constraints.
----------------
Abu
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

But that wasn't the question.

To be absolutely sure that the hashed file is cleared use a before-stage or before-job subroutine ExecTCL to clear the hashed file. The command is CLEAR.FILE hashedfilename (which requires a VOC entry for hashedfilename).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or link a standalone Transformer to it to perform the Clear. Create a stage variable so it will compile, use the proper metadata (doesn't matter what's in the derivation, I use @NULL) set the constraint to @FALSE and enable the 'Clear' option. It will run first and clear the hashed file.
-craig

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