Hi everybody
I have a job which read the Balance_CG.csv file for write in a Oracle table.
After reading this file, I must copy the data in a new file named Balance_CG_yyyymmdd.csv and empty the first file.
How can I do that ?
Thank you everybody for you help.
Frederic from Paris (France)
Rename a file and empty a file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi Sant,
By emptying the first file, if you meant delete the file
Then you need to call a shell script in the After job routine to delete the file ( you can use rm <filename>). If you want an empty file with the same name, use touch command after rm command in your shell script to create an empty file.
You can copy the data into a new file by simply using a transformer after you read the old file and then write to a new file called Balance_CG_yyyymmdd.csv in a sequential file stage.I must copy the data in a new file named Balance_CG_yyyymmdd.csv and empty the first file.
By emptying the first file, if you meant delete the file
Then you need to call a shell script in the After job routine to delete the file ( you can use rm <filename>). If you want an empty file with the same name, use touch command after rm command in your shell script to create an empty file.
Thanks,
Naveen
Naveen
If you copying/renaming needs to be done after the job finishes then you can use after-job-subroutine from job properties.
On the other-hand if its right after reading from file, while the job is running .. I dont think you can achieve this.. as DataStage expects the input-file/data to be there untill job finishes. If you just want to add data to the existing file you can probably use before-stage subroutine from XFM rigt after sequential stage.
On the other-hand if its right after reading from file, while the job is running .. I dont think you can achieve this.. as DataStage expects the input-file/data to be there untill job finishes. If you just want to add data to the existing file you can probably use before-stage subroutine from XFM rigt after sequential stage.
thank you
- prasad
- prasad
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom