pour les sleeps et les exit+ les shout, il est conseill? d'utiliser les exit control-m comme suit:
exemple
set exit="C:\Program Files\BMC Software\CONTROL-M Agent\Default\EXE\_exit.exe"
set shout="C:\Program Files\BMC Software\CONTROL-M Agent\Default\EXE\ctmshout.exe"
for the sleep/exit/and shout it is advisable to use controlm exits
in the script as :
set exit="<agent>\CONTROL-M Agent\Default\EXE\_exit.exe"
...
Philmalmaison
Strategy to deal with Windows "@echo off" problem.
- philmalmaison
- Nouveau
- Posts: 1148
- Joined: 08 Jun 2007 12:00
- Location: Ile de France
ok dont understand how did you check the @echo on without access to the script, but try the following:
ON Statements=* CODE=*phrase* ...
otherwise i can give you an example off using control-m exits in a script, as following:
set OD=%1
set shout="C:\Program Files\BMC Software\CONTROL-M Agent\Default\EXE\ctmshout.exe"
set exit="C:\Program Files\BMC Software\CONTROL-M Agent\Default\EXE\_exit.exe"
for /F "tokens=2" %%i in ('date /T') do set date=%%i
for /F %%i in ('time /T') do set time=%%i
cd \appli\ctrlm.log\V6
echo ******** debut procedure %date% %time% ******** >> stats.log
rem recup des fichiers txt DEPUIS HOMNTSGA1
del *.txt
echo recup des fichiers txt >> stats.log
ftp -vn -s:recept.ftp
if not EXIST ctmstats_pref.txt goto EXITNOTOK
if not EXIST ctmstats_pgem.txt goto EXITNOTOK
if not EXIST ctmstats_pftm.txt goto EXITNOTOK
rem execution de la macro de mise a jour
echo execution de la macro de mise a jour >> stats.log
"C:\Program Files\Microsoft Office\OFFICE11\excel.exe" macro_indicateurs_sgam.xls
rem envoi du resultat sur homtsga1
echo envoi du resultat sur homtsga1 >> stats.log
ftp -vn -s:envoi.ftp
:EXITOK
exit
:EXITNOTOK
%shout% -ORDERID %OD% -USER ECS -MESSAGE "Erreur de transfert (ftp) faire un RERUN du job svp." -SEVERITY v
echo ======================== ERREUR DE FTP ============================ >> stats.log
%exit% 1
ON Statements=* CODE=*phrase* ...
otherwise i can give you an example off using control-m exits in a script, as following:
set OD=%1
set shout="C:\Program Files\BMC Software\CONTROL-M Agent\Default\EXE\ctmshout.exe"
set exit="C:\Program Files\BMC Software\CONTROL-M Agent\Default\EXE\_exit.exe"
for /F "tokens=2" %%i in ('date /T') do set date=%%i
for /F %%i in ('time /T') do set time=%%i
cd \appli\ctrlm.log\V6
echo ******** debut procedure %date% %time% ******** >> stats.log
rem recup des fichiers txt DEPUIS HOMNTSGA1
del *.txt
echo recup des fichiers txt >> stats.log
ftp -vn -s:recept.ftp
if not EXIST ctmstats_pref.txt goto EXITNOTOK
if not EXIST ctmstats_pgem.txt goto EXITNOTOK
if not EXIST ctmstats_pftm.txt goto EXITNOTOK
rem execution de la macro de mise a jour
echo execution de la macro de mise a jour >> stats.log
"C:\Program Files\Microsoft Office\OFFICE11\excel.exe" macro_indicateurs_sgam.xls
rem envoi du resultat sur homtsga1
echo envoi du resultat sur homtsga1 >> stats.log
ftp -vn -s:envoi.ftp
:EXITOK
exit
:EXITNOTOK
%shout% -ORDERID %OD% -USER ECS -MESSAGE "Erreur de transfert (ftp) faire un RERUN du job svp." -SEVERITY v
echo ======================== ERREUR DE FTP ============================ >> stats.log
%exit% 1