How do i timestamp a file in DS?
Thanks
How to timestamp a file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 151
- Joined: Fri Feb 13, 2009 4:19 pm
After you create the file use the after job subroutine to rename/ move the file with a new file name.
Use the following command to rename with date or date and time
Example
file name: New.txt
mv New.txt New_`date '+%Y%m%d%`
this will rename the file with the date
-----------
If you want to add timestamp to the file then use this
mv New.txt New_`date '+%Y%m%d%H%M%S'`
Use the following command to rename with date or date and time
Example
file name: New.txt
mv New.txt New_`date '+%Y%m%d%`
this will rename the file with the date
-----------
If you want to add timestamp to the file then use this
mv New.txt New_`date '+%Y%m%d%H%M%S'`
Thanks
Karthick
Karthick
If using a sequence to call your job, an alternative is to pass the date in as a parameter... (User Variable set to Date()). This way, if you ever do a "View Data" on the file, at least then the file will exist.
(And take away the panic of being told the file does not exist despite the fact you have just created it!)
(And take away the panic of being told the file does not exist despite the fact you have just created it!)