Strategy to deal with Windows "@echo off" problem.

Tools and several solutions to manage Control-M products
Post Reply
User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 11 Jul 2007 3:34

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"
...
:wink:
Philmalmaison

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

Post by philmalmaison » 18 Jul 2007 2:37

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

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 19 Jul 2007 9:02

Consider also that with the "@echo off" you cant see only the commands.
In windows i haved some problems using:

ON Statements=command CODE=*phrase* ...

but use:

ON Statements=* CODE=*phrase* ...

And follows the "philmalmaison" mode, with "_exit".

Post Reply