Naming a file with the current timestamp?
Moderators: chulett, rschirm, roy
Naming a file with the current timestamp?
Hi all,
How to have a file name as the timestamp?
For example:
The file name should be
20070802213012.txt
How to have a file name as the timestamp?
For example:
The file name should be
20070802213012.txt
222102
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
Using Job Parameters
Hi,
When you use a parallel extender, there s an option to include job parameter for the file name.
1) Declare a job parameter of time type.
2) Use that inside the filename column.
I think this would solve the problem.
When you use a parallel extender, there s an option to include job parameter for the file name.
1) Declare a job parameter of time type.
2) Use that inside the filename column.
I think this would solve the problem.
Just a suggestion .
I have similar requirement and did something as below.
Achieved in Job sequence.
1) Used UserVariables activity stage(named as UV_FileDate) which passes timestamp as parameter FileDate
OCONV(@DATE, "D4YMD[4,2,2]"):'':Ereplace(OCONV(@TIME,"MT"),':','') to the job activity stage .
2) Filename in the job activity stage looks like this
'Products_':Ereplace(UV_FileDate.FileDate,'/',''):'.CSV'
Hope this information is of any help.
Thanks
Paddu
I have similar requirement and did something as below.
Achieved in Job sequence.
1) Used UserVariables activity stage(named as UV_FileDate) which passes timestamp as parameter FileDate
OCONV(@DATE, "D4YMD[4,2,2]"):'':Ereplace(OCONV(@TIME,"MT"),':','') to the job activity stage .
2) Filename in the job activity stage looks like this
'Products_':Ereplace(UV_FileDate.FileDate,'/',''):'.CSV'
Hope this information is of any help.
Thanks
Paddu
-
- Participant
- Posts: 132
- Joined: Wed Mar 01, 2006 11:12 pm
- Location: Pune
Even it is achievable using unix script in a after job routine where in you can rename the file to attach the timestamp part to it. We have done this in one of our job.paddu wrote:Just a suggestion .
I have similar requirement and did something as below.
Achieved in Job sequence.
1) Used UserVariables activity stage(named as UV_FileDate) which passes timestamp as parameter FileDate
OCONV(@DATE, "D4YMD[4,2,2]"):'':Ereplace(OCONV(@TIME,"MT"),':','') to the job activity stage .
2) Filename in the job activity stage looks like this
'Products_':Ereplace(UV_FileDate.FileDate,'/',''):'.CSV'
Hope this information is of any help.
Thanks
Paddu
SMB