AFT Advanced Post FTP Command rename with Date-time

All questions about Control-M jobs definitions
Post Reply
User avatar
Nightwatchrenband
Nouveau
Nouveau
Posts: 28
Joined: 24 Jul 2012 12:00
Location: Long Beach, CA

AFT Advanced Post FTP Command rename with Date-time

Post by Nightwatchrenband » 21 Feb 2014 5:51

News alert. %%DATE %%$DATE %%TIME all receive their values at Job Submission time. Indeed, when the job is Ordered, that time is set. So, If you have a AFT with FileWatch and add date-time to the file name using %%DATE-%%TIME then your values will be wrong, perhaps wildly wrong (by the time from Order to FW trip). SO I tried using the Post FTP Command Rename. It works fine with simple renames to fixed values, but I assumed that it could take actual Unix functions. SO far no good. A unix command which works fine in Unix like >>> mv /u01/bmc/test/aix13.txt /u01/bmc/test/aix13.txt-`date '+%Y-%m-%d:%H:%M:%S'` Totally fails is you use /u01/bmc/test/aix13.txt-`date '+%Y-%m-%d:%H:%M:%S'` in the "rename to" field. Not sure why. Anybody have any ideas. Yes, I know I could add another CTM job and run the Unix command, but that means the Time is off by a minute or two at least.

User avatar
Nightwatchrenband
Nouveau
Nouveau
Posts: 28
Joined: 24 Jul 2012 12:00
Location: Long Beach, CA

Reply to my own post

Post by Nightwatchrenband » 21 Feb 2014 7:25

On another point about the AFT FW. When I look at the AFT FT window, I have a field Auto-Edit containing detected file name %%. See below. Now this value cannot possibly be known to CTM until the file is created. Which may be days after the job started executing. So it would seem that CTM can assign values when the file is found. If they can do that, it would seem reasonable that they could assign a %% for the current date-time as well.
The need for this is extremely common. I am surprised that BMC has not come up with something like this yet.
For now It looks like I am going to have to add another job which does The unix rename with date-time

Post Reply