Error calling routine DSSendmail

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Error calling routine DSSendmail

Post by kris007 »

Hi All,

I am getting the following error when my job is aborting in the sequence and I am not getting the email

Controller problem: Error calling DSRunJob(JOB_NAME), code=-2
[Job is not in the right state (compiled and not running)]
Will execute error activity: Exception_Handler
JobControl (DSSendMail): Parameter 4 ('[Job is not in the right state (compiled and not running)], Job aborted') does not start with a keyword
JobControl (@failure_email): Controller problem: Unhandled failure (-19) encountered calling routine DSSendMail

Error while executing error activity: Exception_Handler
I have ExceptionHandler---NotificationActivity-----Utilityaborttologroutine

in my Job sequence. Does this mean I am not using the Exception Handler stage properly.

Thanks
Kris.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's a tricky one, because your job did not abort. It couldn't be started, because it was not in a runnable state. Is your execution rule "reset if required, then run"?
There is also a problem with what you're feeding to the Notification Activity, but do solve the first problem first. After all, what has been fed to the Notification Activity is an artifact of the failure mode.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Thanks Ray..I did take care of the problem. My concern was why I couldnt get the email..but as you said my job didnt abort..it just cudnt start.That answers my doubts.

Kris.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Kris

Did you got any emails when the Sequence aborted first.?
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Siva..

yeah..I got the emails when the job aborted first. Then I restarted the job again but my JobActivity was not set to 'reset if required and run' and hence the error. Is there anything I need watch out for. Please let me know.

Kris
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Kris

I wanted to make sure that you received the first notification thro email.

"Reset if required and Run" is the one you need to watch. You will be fine once it is set.
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Siva,

When I Abort the job by passing wrong values as parameters I am getting an email saying the Job is aborted. But I am still getting the following error.

Code: Select all

obControl (@UTILITYWARNINGTOLOG_routine): Controller problem: Unhandled failure (1) encountered calling routine DSX.UTILITYWARNINGTOLOG
Error while executing error activity: exception_handler
I am giving an simple text as an argument in the routine.

Thanks
Kris
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

At what stage the sequence is getting failed. And what is the trigger you use in the stage. One of the reason the Unhandled failure arised, when the failure trigger not been handled.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Its failing in the jobactivity stage. I am passing the wrong parameters deliberately to abort it and check it. I have two triggers.on OK and one Warnings.
Now, please correct if I am wrong. The error message

Code: Select all

JobControl (@UTILITYWARNINGTOLOG_routine): Controller problem: Unhandled failure (1) encountered calling routine DSX.UTILITYWARNINGTOLOG 
Error while executing error activity: exception_handler
is saying that the Routine UtilityWarningtoLog is being called or is it saying that it encountered problems calling that routine and hence it cant execute the Exception Handler.

Thanks
Kris.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's telling you that you invoked UtilityWarningToLog (presumably in a Routine activity) and that UtilityWarningToLog returned 1 (which it does) and that you did not have a trigger to handle a return value of 1. With routines the rule is that the job sequence will report a failure unless the return value is 0, unless there is a specific handler for non-zero return values. It does the same with Execute Command activity; if the exit status is not zero a "failure" is detected. Since UtilityWarnToLog always returns 1 (inspect its code), either add a trigger to handle this, or clone the routine and change it so that it only returns 0.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Once I had such scenario from Comnand Activity, which replies 0 - Success, 1 - Warining, 2 - Error. Though I handled all the error code in the trigger section, it throwed me unhaldled error for reply 1. We manage to solve by giving 'Otherwise' trigger only for that condition.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It wasn't the Execute Command activity. Read the error message again. It was the Routine activity through which you invoked UtilityWarningToLog.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Thanks Ray. That helps. :)

Kris
Post Reply