Hashed File record Clearance

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
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Hashed File record Clearance

Post by satheesh_color »

Hi All,

I have a problem in hashed File.I have an hashed file which has 3 input links.All of them write into the same hashed file..Eg;PartitionHash.

Input1.SaleDay Partition Information.(PYYYYMMDD)
Input2.SaleWeek Partition Information(PYYYYMMDD)
Input3.SaleMonth Partition Information.(PYYYYMM)

The above 3 inputs use thesame hashed file PartitionHash. For each input i checked the Deletefile before create option.All of them pointing to the same File.

So when a job is run a second time it still writes out the records from the first run. I added a step earlier in the job to clear the hashes.
by passing @NULL to the columns of HashedFile before writing the records..and removed the option DeleteFile..No luck.

So how can we handle this situation in DS? Please advise.

Satheesh.
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

In the INPUT tab of the hashed file, check the "Clear file before writing" box.
Ross Leishman
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use ExecUV as a before-job subroutine. Execute a CLEAR.FILE command to clear all records from the hashed file. Change your Hashed File stages so that they do not delete before writing.

If you have created the hashed file in a directory you will need to create a VOC pointer to it using a SETFILE command in order for the CLEAR.FILE command to work.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Post by satheesh_color »

Hi Ray,

Thanks for your input. I have two hashed files like the above mentioned..I need to clear the both..can we have any option to clear both the file by using Clear.File command.


Satheesh.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Issue both CLEAR.FILE commands adjacently in the Administrator client Command window. Then select both commands from the history pane and click Save. You will be prompted for a name under which to save, I suggest something meaningful like CLEAR_TWO_HASHED_FILES. Then, in your job, execute CLEAR_TWO_HASHED_FILES using the ExecUV before-job subroutine, rather than a CLEAR.FILE command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply