Hi,
Have a batch file here that executes some steps and before and after every step it echoes the system date and time to a log file.. the thing is that when we run the batch file manually, the date and time for every step is showed correctly.. but through CTM the date and time showed are the same for every step..
Does anyone know why this happens and how can I correct it?
Thx in advance,
Filipe
script:
ECHO . >> %$LogFile%
ECHO ------------------Step1-------------------------- >> %$LogFile%
ECHO Begin : %DATE% %TIME% >> %$LogFile%
...
...
...
ECHO End : %DATE% %TIME% >> %$LogFile%
Manually Executed Log:
.
---------------Step1-------------------
Begin : 02-03-2009 11:10:43,05
End : 02-03-2009 11:10:52,16
-----------------------------------------
.
---------------Step2-------------------
Início : 02-03-2009 11:10:52,16
Terminado com sucesso.
Fim : 02-03-2009 11:10:55,16
-----------------------------------------
.
---------------Step3-------------------
Begin : 02-03-2009 11:10:55,16
End : 02-03-2009 11:10:58,16
-----------------------------------------
.
---------------Step4-------------------
Begin : 02-03-2009 11:10:58,16
End : 02-03-2009 11:11:01,27
-----------------------------------------
CTM executed Log:
.
---------------Step1-------------------
Begin: 090302 111222
End : 090302 111222
-----------------------------------------
.
---------------Step2-------------------
Begin : 090302 111222
End : 090302 111222
-----------------------------------------
.
---------------Step3-------------------
Begin : 090302 111222
End : 090302 111222
-----------------------------------------
.
---------------Step4-------------------
Begin : 090302 111222
End : 090302 111222
-----------------------------------------
system date and time on windows script question
- philmalmaison
- Nouveau
- Posts: 1148
- Joined: 08 Jun 2007 12:00
- Location: Ile de France
Hallo,
i had the same problem with Control_M and Agent 6.3.01.
In control_M 6.3.01 if you have in your config file from CTM-Server the variable "AUTOEDIT_INC_SEC SYSTEM".
Then the control_m server send to the agent every time you run a job the autoedit variable from the server, so at first place for date is the date from the server and not from the agent.
You can change the variable into Global, Group or local.
I hope you have untersand my greekenglish
Regards
Vassilis
i had the same problem with Control_M and Agent 6.3.01.
In control_M 6.3.01 if you have in your config file from CTM-Server the variable "AUTOEDIT_INC_SEC SYSTEM".
Then the control_m server send to the agent every time you run a job the autoedit variable from the server, so at first place for date is the date from the server and not from the agent.
You can change the variable into Global, Group or local.
I hope you have untersand my greekenglish
Regards
Vassilis
It is correct that Control-M system variables are being passed into the job environment variables. The fact that date is displayed as 090302 instead of 02-03-2009 is a good proof.
I had a similar situation using a job variable %%PATH. Upon job execution, there were a lot of unrecognized commands errors. That was because PATH variable at Windows was being overwritten by PATH variable from job.
Watch out not to use any existing env variables at OS as Control-M job variables. Same deal for Windows and Unix.
I had a similar situation using a job variable %%PATH. Upon job execution, there were a lot of unrecognized commands errors. That was because PATH variable at Windows was being overwritten by PATH variable from job.
Watch out not to use any existing env variables at OS as Control-M job variables. Same deal for Windows and Unix.
- th_alejandro
- Nouveau
- Posts: 188
- Joined: 26 Nov 2008 12:00
- Location: Bogotá
thy this.
try this instruction (AIX) :
date +%H%M%S
This get time from your execution (nodeid) machine (not control-m server). For other operational systems consult your equivalent instruction.
I put this instruction has a function that is called from ALL script at start and end of each job.
date +%H%M%S
This get time from your execution (nodeid) machine (not control-m server). For other operational systems consult your equivalent instruction.
I put this instruction has a function that is called from ALL script at start and end of each job.