Suppose my file in X location is ->ABCD.txt
Move to Y location with appending timestamp.
like
ABCD.20140509094707.txt
What i did
But the out put I am getting in job after difined a variable is
ABCD.20140509094707txt
Where variable defined is
%%TIMEST=%%$DATE.%%TIME
And command is
move D:\ABCD.txt D:\DD\ABCD.%%TIMEST.txt
But the output is ABCD.20140509094707txt
so file type is not recognized as .txt as "." missing before "txt"
Thanks for your valuable inputs here
I am working on Control-M V8
how to move a file to new location with time stamp
could you try something like:
move D:\ABCD.txt D:\DD\ABCD."%%TIMEST".txt
or
move D:\ABCD.txt D:\DD\ABCD."%TIMEST%".txt
or set a cmd variable like:
set ts=%%TIMEST & move D:\ABCD.txt D:\DD\ABCD."%ts%".txt
i don't have the enviroment to test right now, the last one will work as you are using "move" so you are using a windows based os.
move D:\ABCD.txt D:\DD\ABCD."%%TIMEST".txt
or
move D:\ABCD.txt D:\DD\ABCD."%TIMEST%".txt
or set a cmd variable like:
set ts=%%TIMEST & move D:\ABCD.txt D:\DD\ABCD."%ts%".txt
i don't have the enviroment to test right now, the last one will work as you are using "move" so you are using a windows based os.
Thanks Carlos,jCarlos wrote:could you try something like:
move D:\ABCD.txt D:\DD\ABCD."%%TIMEST".txt
or
move D:\ABCD.txt D:\DD\ABCD."%TIMEST%".txt
or set a cmd variable like:
set ts=%%TIMEST & move D:\ABCD.txt D:\DD\ABCD."%ts%".txt
i don't have the enviroment to test right now, the last one will work as you are using "move" so you are using a windows based os.
It working fine for me.
Thanks once again
If you are using the CM for Advanced File Transfer to move the file use below
for D:\DD\$$AFTFILE$$.%%$DATE.%%TIME for ABCD.yyyymmddhhmmss.txt (need dot after last $ sign to get the dot after ABCD)
and use D:\DD\$$AFTFILE$$%%$DATE.%%TIME for ABCDyyyymmddhhmmss.txt but I think you are using some kind of script.
for D:\DD\$$AFTFILE$$.%%$DATE.%%TIME for ABCD.yyyymmddhhmmss.txt (need dot after last $ sign to get the dot after ABCD)
and use D:\DD\$$AFTFILE$$%%$DATE.%%TIME for ABCDyyyymmddhhmmss.txt but I think you are using some kind of script.