Page 1 of 1

Hashed File record Clearance

Posted: Thu Dec 20, 2007 1:16 am
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.

Posted: Thu Dec 20, 2007 1:37 am
by rleishman
In the INPUT tab of the hashed file, check the "Clear file before writing" box.

Posted: Thu Dec 20, 2007 1:39 am
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.

Posted: Thu Dec 20, 2007 5:09 am
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.

Posted: Thu Dec 20, 2007 2:38 pm
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.