system date and time on windows script question

Several scripts
Post Reply
User avatar
fileal2
Nouveau
Nouveau
Posts: 32
Joined: 25 Sep 2008 12:00

system date and time on windows script question

Post by fileal2 » 04 Mar 2009 1:19

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
-----------------------------------------

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 05 Mar 2009 2:28

i think there is something wrong, controlm using %DATE od %TIME as a global variable ...


regards
philmalmaison

vassi168

Post by vassi168 » 05 Mar 2009 3:00

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

User avatar
gglau
Nouveau
Nouveau
Posts: 317
Joined: 13 Jun 2007 12:00

Post by gglau » 07 Mar 2009 3:09

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.

User avatar
th_alejandro
Nouveau
Nouveau
Posts: 188
Joined: 26 Nov 2008 12:00
Location: Bogotá

thy this.

Post by th_alejandro » 27 Apr 2009 11:09

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.

Post Reply