Exception Handler Not Working when DS invoked from Shell Scr

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Exception Handler Not Working when DS invoked from Shell Scr

Post by nvalia »

Hi All,

DS 8.7 on Windows

I have a Sequence job that has an Exception Handler stage that sends an email in case of an exception. When I run (fail) this job from the Designer Client it works fine, meaning sends an Email in case of failure, as expected.

But when I Invoke the same job with same parameter sets from a shell script it does NOT send out the email in case of failure, as we would expect

(for Email we are calling a Stored Procedure from a batch file invoked from the Execute Command activity)

Job Activity (SU) --> Job Activity (SU) --> Execute Command (Success Email)

Exception Handler --> Execute Command (Failure Email) --> Terminator Stage

For Success email it works both ways

Thanks
NV
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Post by nvalia »

Resolved

This was happening because the dsjob was called from the shell script using the option -warn 1 and hence as soon as the first warning prior to the failure was logged, the job aborted and hence the Exception Handler was not executed (hence no email)

Changed this to -warn 2 in the dsjob command and now it is sending the failure email as expected.
Post Reply