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
file should be cleared after taking values from the file
Moderators: chulett, rschirm, roy
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.
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
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!
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!
Vignesh.
"A conclusion is simply the place where you got tired of thinking."
"A conclusion is simply the place where you got tired of thinking."
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
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.
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers