Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to catch stored procedure errors in Maestro?

Status
Not open for further replies.

JessieJames

IS-IT--Management
Sep 20, 2002
2
US
Hello,

I am new to UNIX commands and have been looking all over for commands that will catch a store procedure error and send that error to maestro (Tivoli vendor). Maestro is our scheduling tool. Currently our unix batch may error when executing a stored procedure but the error is not caught by Maestro. Please advise
Thank you in advance for your help.

Jessie
 
Add the following error checks in the .bat executable script that maestro uses to schedule the job. The script will abend and force maestro to recognize it. This work best in a NT environment but can be converted to UNIX. Of course this script is unique to itself, your may be different.

=====================================

REM *** Check for error messages ***

:error_check1
find /c /i "deadlock" cdscderror.log
if errorlevel = 1 goto errorcheck2
goto abend1
:abend1
echo Deadlock error found in cdscerror.log. Please investigate
goto abend

:errorcheck2
find /c /i "not connected" cdscderror.log
if errorlevel = 1 goto errorcheck3
goto abend2
:abend2
echo Not Connected error found in cdscerror.log. Please investigate
goto abend

:errorcheck3
find /c /i "integrity constraint" cdscderror.log
if errorlevel = 1 goto errorcheck4
goto abend3
:abend3
echo integrity constraint error found in cdscerror.log. Please investigate
goto abend

:errorcheck4
find /c /i "DELETE WEEK ERROR" cdscderror.log
if errorlevel = 1 goto errorcheck5
goto abend4
:abend4
echo DELETE WEEK ERROR found in cdscerror.log. Please investigate
goto abend


:errorcheck5
sqlplus cdsinterface/cdsinterface@cdsp @e:\win32app\cds\cdserrorlog.sql >cdsgemssched.log

find /c /i "deadlock" cdsgemssched.log
if errorlevel = 1 goto errorcheck6
goto abend5
:abend5
echo Deadlock error found in cdscerror.log. Please investigate
goto abend

:errorcheck6
find /c /i "not connected" cdsgemssched.log
if errorlevel = 1 goto errorcheck7
goto abend6
:abend6
echo not connected error found in cdscerror.log. Please investigate
goto abend

:errorcheck7
find /c /i "integrity constraint" cdsgemssched.log
if errorlevel = 1 goto errorcheck8
goto abend7
:abend7
echo ntegrity constraint error found in cdscerror.log. Please investigate
goto abend

:errorcheck8
find /c /i "DELETE WEEK ERROR" cdsgemssched.log
if errorlevel = 1 goto end
goto abend8
:abend8
echo DELETE WEEK ERROR error found in cdscerror.log. Please investigate
goto abend

:end
exit 0




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top