How to Attach a Log File in Email-Notification activity

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
kishorebhulokam
Participant
Posts: 9
Joined: Thu Jul 10, 2008 6:18 pm

How to Attach a Log File in Email-Notification activity

Post by kishorebhulokam »

Hi,

I am using Datastage 7.0, I want to send a log file when the job gets fail.how to Attach a Log File in Email-Notification activity.is there any property to set this ..

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

Post by ray.wurlod »

DataStage does not have log files. Job logs are database tables.

What kind of log file are you wishing to attach?

Being on version 7.0 you will need to write your own routine to invoke sendmail() with attachments. The ability to do this from DataStage was introduced in version 7.5.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kishorebhulokam
Participant
Posts: 9
Joined: Thu Jul 10, 2008 6:18 pm

Post by kishorebhulokam »

we have a routine attaches the report lot file and sends it across for the email ids configured. Email ids are configured in address_book.ini file placed in DS unix path.
kishore
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you have a routine already, what's the problem?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: How to Attach a Log File in Email-Notification activity

Post by chulett »

kishorebhulokam wrote:I am using Datastage 7.0, I want to send a log file when the job gets fail.how to Attach a Log File in Email-Notification activity.is there any property to set this ..
No, not until you upgrade to at least the 7.5 version. Stick with your routine for now.
-craig

"You can never have too many knives" -- Logan Nine Fingers
filename.txt
Participant
Posts: 27
Joined: Thu Mar 20, 2008 11:55 am

Post by filename.txt »

How to get detail Job Log in email using notification activity in DS 7.5 ?

Right now.. I am using IncludeJobStatus in Notification Activity Stage.
But, It just provides me whether job activity finished sucessfull or Aborted. It doesn't give me the error details if a JobActivity Fails.
Thanks.

"Creativity is the ability to use your available resources to their fullest."
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted above, you would need to create a routine to dump the desired log to a text file, then that file can be added as an attachment to a Notification email. The "7.5 version" reference was for the attachment part, not the job log part.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

Alternately after your job failure/completion run the command or create a shell script where in the job name,project name is passed dynamically with the following command in the shell script ...

dsjob -logsum <project name> <job name>

Have a Notification activity stage which attaches this log file.

Regards,
Vinod
filename.txt
Participant
Posts: 27
Joined: Thu Mar 20, 2008 11:55 am

Post by filename.txt »

Thanks for the reply Vinod,

I tried the command, These were the output lines.

117 INFO Mon Nov 10 13:51:03 2008
main_program: Explanation: (...)
118 INFO Mon Nov 10 13:51:04 2008
main_program: Dump: (...)
119 INFO Mon Nov 10 13:51:04 2008
main_program: This step has 1 dataset: (...)
120 INFO Mon Nov 10 13:51:05 2008
main_program: Schemas: (...)

How to eliminate these (...) and print full information ?
Thanks.

"Creativity is the ability to use your available resources to their fullest."
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You would need to use -logdetail instead, a much more involved process because of the additional parameters it needs.
-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 »

One of the jobs in EtlStats.zip will send the log as email attachment. It is designed to send only jobs that fail. The source is included so you can modify it to send all.
Mamu Kim
filename.txt
Participant
Posts: 27
Joined: Thu Mar 20, 2008 11:55 am

Post by filename.txt »

How do I get the log details of a job (job activity) inside a sequence job ?

If I have Sequence job with couple of Job activites..

Job1==>Job2===>Job3

then the log of Sequence Job shows something like below...

Job1 Finished,Status=1(Finished OK)
Job2 did not finish OK, status = 'Finished with warnings'
Job3 aborted reply 255

How can I get the log details of Job2 & Job3 in log details of Sequence job itself ?
Thanks.

"Creativity is the ability to use your available resources to their fullest."
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Just take a look at the GENERAL tab of JOB properties for the Sequence. You can get log msgs (warning/error msgs only) of jobs in the log msg of the Sequence
Post Reply