Page 1 of 1

How to Attach a Log File in Email-Notification activity

Posted: Tue Sep 16, 2008 11:47 pm
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

Posted: Tue Sep 16, 2008 11:57 pm
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.

Posted: Wed Sep 17, 2008 12:00 am
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.

Posted: Wed Sep 17, 2008 12:30 am
by ray.wurlod
If you have a routine already, what's the problem?

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

Posted: Wed Sep 17, 2008 7:08 am
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.

Posted: Mon Nov 10, 2008 1:26 pm
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.

Posted: Mon Nov 10, 2008 1:31 pm
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.

Posted: Mon Nov 10, 2008 2:34 pm
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

Posted: Mon Nov 10, 2008 4:38 pm
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 ?

Posted: Mon Nov 10, 2008 4:41 pm
by chulett
You would need to use -logdetail instead, a much more involved process because of the additional parameters it needs.

Posted: Mon Nov 10, 2008 5:16 pm
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.

Posted: Tue Nov 11, 2008 2:53 pm
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 ?

Posted: Tue Nov 11, 2008 3:01 pm
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