Hi,
We have a requirement to append timestamp of particular format
MMDD.HHMM to the file name.
Due to performance issues, we have to avoid using unix-scripting/routine for this purpose.
Any idea for adding this timestamp, in the same job,while the file is created, would be appreciated.
Cheers!
To Append timestamp to file name:filename.MMDD.HHMM
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: To Append timestamp to file name:filename.MMDD.HHMM
Who said?seemamone wrote:Due to performance issues, we have to avoid using unix-scripting/routine for this purpose.
Ask someone who knows what they're talking about.
You ultimately have to execute a single UNIX mv command, irrespective of where you do it. As Craig said, there is no "performance issue".
Indeed, the overhead of not using a script is likely to be greater, since you can use the UNIX date command in the same command to give you your file name suffix.
Code: Select all
mv filename filename.`date "+%m%d.%H%M"`
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.
DS command to format TIMESTAMP to <MMDD>.<HHMM>
thanks for the reply to my earlier post:)
Do we have a DS command to translate the timestamp value as per our requirement, e.g : <MMDD>.<HHMM>
thanks in advance
Do we have a DS command to translate the timestamp value as per our requirement, e.g : <MMDD>.<HHMM>
thanks in advance
Seema
Substring ( [] ) or OConv pairs with the proper coversion codes & masks, then concatenate with a dot between would do the trick. Assuming an ISO standard timestamp format:
One example. You could also substring out the two parts with the dashes, concatenate them then do a 'post' convert to remove them. Always more than one way to skin the cat, as they say. ![Wink :wink:](./images/smilies/icon_wink.gif)
Code: Select all
Convert("-","",YourTimestamp)[5,4] : "." : Convert("-","",YourTimestamp)YourTimestamp[10,4]
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers