Log File as an attachment in Email

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

Log File as an attachment in Email

Post by DSRajesh »

Hi All,

In a job sequence there are 4 different job activities and each activity attached with Email notification activity for failed trigger.

we need to attach the datastage job log file with email notif

The format of the log file would be Jobname_Timestamp_item.txt where Jobname and timestamp will vary and how to get this file and attach in the in the Email notification activity.
RD
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The email stage lets you specify a variable attachment file name, i.e. one that you can compute in a Routine-Activity.

Are you asking about how to create this log file in the job sequence?
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Hi Arndw,

I am using a routine in the job sequence which will create the log file and and attaching Email Notification Activity.

The File name convention is Jobname_Timestamp_item.txt
where jobname is changing based on the job activity from file is created.

I am looking for how to attach a particular log file based on the job failed.

How to pass the parameter in the attachement column of email notification activity.
RD
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Hi All,

Looking forward for the sugession from any one.
RD
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The simplest is that your routine (which is probably programmed as a function) returns the name of the file it created back to the job sequence. You can then access that return value and use it as your attachment name.
sirishds
Participant
Posts: 18
Joined: Sat Jun 12, 2010 11:28 pm

Post by sirishds »

Hi,

You may have to change your routine such that it would save the log file as per the requiredconvention.so that going forward you can directly attach the file By means of notification Activity.

Option 2: Hope the log file would be saved in the DSsrver.You can use UNIX commands to change the job convention as required then attach the file using notification activity.

Hope this should help.

Thanks,
Sirish.
Post Reply