Deletion Of Hashed 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
vinaypothnis
Participant
Posts: 18
Joined: Mon Nov 18, 2002 4:02 am
Location: India

Deletion Of Hashed Files

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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
Post Reply