Hi Dsxians,
After processing my source file by the datastagejob i am archiving that file
by writing the following command in after job subroutine.
mv #dstage_data_dir#/MSG.txt #dstage_tmp_dir#/MSG.txt.#proc_dt#
proc_dt is one of the parameter which is passing current date.I am getting the source file five times a day and archived file is getting overwritten by 5 files data.
I want to replace proc_dt with timestamp or some unique identifier so that i will get 5 archived files for that particular day.Could any one plz help me out in solving this problem.
Thanks
tom
Archiving processed file with timestamp
Moderators: chulett, rschirm, roy
Archiving processed file with timestamp
Devlopers corner
-
- Participant
- Posts: 437
- Joined: Fri Oct 15, 2004 6:13 am
- Location: Pune, India
In move command use the date command so that it will also have seconds as a part of the file name.
So the command will be:
So the command will be:
Code: Select all
mv #dstage_data_dir#/MSG.txt #dstage_tmp_dir#/MSG_`date '+%Y%m%d%H%M%S'`.txt
Regards,
S. Kirtikumar.
S. Kirtikumar.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Pass a timestamp in to the job parameter or, if proc_dt is also used elsewhere in the job, provide an additional parameter containing the timestamp and use that as the file name suffix.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.