Job abort message as an attachement in email notification

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
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Job abort message as an attachement in email notification

Post by DSRajesh »

Dear All,

I have requirement with when ever job fails in a sequence i need to send the error message with the job failed along with job status in email notification.

I am not sure of to how to get the aborted message and send as an attchement in email

Looking farward for suggestion from any one

Thanks
RD
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The Notification Activity stage will do that automatically in a Sequence job if you enable the 'Include status' option. Now, it won't be an attachment but you should have the basic information you need with very little effort.

If what you 'need' to pull are the actual error message(s) from the job's log and attach them, you'll need some custom code that leverages the API for the various DSGetLog functions and writes that information to a flat file. The Notification Activity stage can then send that file as an attachment. Or you can script all that from the command line using dsjob and something like sendmail if (for example) you have a job 'wrapper' script that launches all of your jobs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

I have checked the option "Include Job Status in Mail" and able to see all job run information including which job got aborted.

But i need to capture the error message with which job has got failed.

Can you please suggest me how can i capture the error message in email notification
RD
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Chullet

Could you please suggest me some thing here
RD
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The second paragraph of Craig's post tells you what you need to do.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Hi

My membership is expired and will renew in a week.

I am unable to see the remaining post send by craig.

Request you to please give the solution for the error message issue.
RD
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It boils down to the answer that there is not built-in way to do this directly in the job, but with sendmail and the DataStage BASIC API it is possible to program this yourself.
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Anrnw,

What basic api function will be helpful to extract the error mesage
RD
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm not Arnd but you can check the help index and look for any that start with 'DSGetLog'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You could script it with the command line tools. I might of posted a script for this. Need to shell out to run script.
Mamu Kim
Post Reply