Page 1 of 1

file should be cleared after taking values from the file

Posted: Thu Feb 24, 2005 4:03 am
by rajiivnb
Hi,
I have certain values from a flatfile to be moved to a table and once it is moved i should be able to clear the file for next process.How could this be made possible.

Thanks in advance.
Regards,
Rajiivnb

Posted: Thu Feb 24, 2005 4:08 am
by ArndW
Rajivnb,

do you mean you want to clear the flatfile after you have finished loading the data to the table?

In that case, use an after-job routine that executes a shell command to delete the file - you can specify the shell command in the job properties.

Posted: Thu Feb 24, 2005 4:23 am
by rajiivnb
Hi Arnd,
That was really Helpful.Is it possible for you to pass me a shell command that the way to invoke the command in the after routine.

Regards,
Rajiivnb

Posted: Thu Feb 24, 2005 4:47 am
by vigneshra
Rajiv
It's quite simple! You can use a shell command as an after job subroutine like echo '' > File1. Care should be taken to set the option that this command should execute only if the job completes successfully or otherwise you will lose your file.
Alternatively you can also achieve this by calling the same command after the job successfully executes from the shell script itself which you are using to run your job. Hope it is clear for you!
Thanks!

Posted: Thu Feb 24, 2005 4:47 am
by Sainath.Srinivasan
In Unix, 'rm #pFILENAME#' where pFILENAME is your parameter to hold the file name.

Posted: Thu Feb 24, 2005 8:29 am
by chulett
:idea: I prefer to archive files of this type rather than simply removing them. This could be accomplished using the 'mv' command rather than 'rm', but you'd typically want to take an extra step to 'timestamp' the file as well in a script.

We also use tar and compress to periodically create 'tar balls' of files like this to help manage the storage of them.

Food for thought.