January 1, 2009 at 8:09 pm
This situaton is very specific. I dont understand why the package stops executing. we use autosys to schedule the jobs in our company. my package executes and produces the results I need. but the final task in the package is to send a email notification. This email notification is sent through a script task. Autosys logs will not show any error nor even warning.
Package keeps on running and will not return either to success or failure. It will executes all the tasks before the script task and It gets strucked at script task. that is the final step in the package. Unless and untill I kill the job manually everyday, It will not execute the following day. so, I am killing the job everyday in Production.
help me to fix this....thanks in Advance and ask me if you have any more questions.
January 2, 2009 at 8:21 am
You need to throw a Try - Catch in the script task so it throws an exception, than write the error to your job log file.
Use the following in your Catch section:
Dim JobLogPath As String = Dts.Variables("JobLogPath").Value.ToString
'Put this variable above the Try section so the Catch will see it
Try
....
Catch ex As Exception
Using objWriter As New StreamWriter(JobLogPath, True)
objWriter.WriteLine(String.Format("This job failed. Reason: " & _
ex.ToString & " " & DateTime.Now.ToString))
End Using
Dts.TaskResult = Dts.Results.Failure
End Try
If you debug in BIDS on your local desktop (do this in Dev), then insert a whole bunch of MsgBox() stuff after certain points so you can see what variables or lines might not be getting loaded properly. Also, using Breakpoints can help determine where your failure is.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply