Page 1 of 1

Deletion Of Hashed Files

Posted: Fri Dec 27, 2002 6:10 am
by vinaypothnis
Hi all,

I have created some temporary hash files in my job and i need to delete them after my job.

What is the exact procedure of doing this as the hash file consists of a directory and a file. Which has to be deleted first?

And can we do this is one step using some routine?

Could u please help me regarding this?

Thanks and Regards,
Vinay

Posted: Fri Dec 27, 2002 9:56 am
by chulett
Are you sure you need to delete them when the job finishes? If you will use them again when the job runs next, just let the job delete and recreate them (or empty them) when it starts again.

If you really want to delete them, you should be able to do an after-job 'ExecTcl' and issue a 'DELETE.FILE' on the hash file names. DO NOT delete them directly at the O/S level! You may have to use a different command if the files are not local to the project, others will have to help with that as I'm not at work right now and don't have access to any of my notes.

-craig

Posted: Fri Dec 27, 2002 3:17 pm
by ray.wurlod
The method for deleting a hashed file depends on how it was created which, in turn, depends on how you designed for that to occur. If the hashed file was created by a DataStage job, the command that created it will be logged.
If the command was CREATE.FILE, then the hashed file should be deleted using the DELETE.FILE command (simply DELETE.FILE filename).
If the command was CREATE TABLE, then the hashed file must be deleted using the DROP TABLE command (DROP TABLE filename;).
If the command was mkdbfile (for example if you created the hashed file in a directory rather than an account), then the hashed file should be removed using the recursive form of the operating system's deletion command (that is, rm -r in UNIX, or DEL /S in DOS) applied to the pathname of the hashed file's directory.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518