I have a simple job where I am pulling data from a MS SQL table, doing some minor transforms, then writing to a sequential file stage.
I want to use time to uniquely identify the filename (I have a param in the job for date). Right now my file name in the sequential stage is
my_file_#rundate#.txt Rundate is the job param.
I'd like the file name to look like
my_file_#rundate#.HHMMSS.txt
How can I accomplish this in an elegant manner?
Regards,
CB
Putting timestamp in filename of sequential stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The easiest way is to have the job write to the base file name then have an after-stage or after-job subroutine run a command to change the name of the file.
For example you could invoke ExecSH as the routine, and provide the command
For example you could invoke ExecSH as the routine, and provide the command
Code: Select all
mv #FileName# #FileName#_`date +"%Y%m%d"`_`date +"%H%M%S"`
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.
Ok! Thanks much.
CB
CB
ray.wurlod wrote:The easiest way is to have the job write to the base file name then have an after-stage or after-job subroutine run a command to change the name of the file.
For example you could invoke ExecSH as the routine, and provide the commandCode: Select all
mv #FileName# #FileName#_`date +"%Y%m%d"`_`date +"%H%M%S"`