Page 1 of 1

Issue with UtilitySeqEmailAndAbort

Posted: Mon Jul 24, 2006 11:22 am
by crsimms
Hello,

In an effort to add additional event notification to production support for our ETL processes, I added calls to the Utility routine UtilitySeqEmailAndAbort in our sequencers. It was working fine and then a few days ago quit. When I look at the log for the sequencer UtilityEmailMsgsSeq and for a particular invocation, the following warning messages is listed:

******************************************************

UtilityEmailMsgsSeq.J_FAA_Xcheck_Keys.JobControl (DSSendMail): Error when executing command: /dwtest/ads/US_DEV/sendmail_UtilityEmailMsgsSeq34402_12642.sh
*** Output from command was: ***
/home/batch/dead.letter... Saved message in /home/batch/dead.letter

The following parameters in the call to DSSendMail were not mentioned in the file 'dssendmail_template.txt': server
Please check any paths in the following command file are correct, and if necessary adjust the 'dssendmail_template.txt' file in the project directory.

Contents of command file:
#! /bin/sh
/usr/lib/sendmail -t <<////
From: '':AbortingJob:''
To: '':SupportEmail:''
Subject: '':SubjectLine:''

'':RoutGetMessages.$ReturnValue:''

////


******************************************************
dssendmail_template.txt:


#! /bin/sh
/usr/lib/sendmail -t <<////
From: %from%
To: %to%
Subject: %subject%
%body%
////

******************************************************

When I initially added the calls to UtilitySeqEmailAndAbort, I did not modify dssendmail_template.txt, and everything was working fine. My questions are:

1) What could cause the above error to suddenly start appearing when the process worked successfully before without the server token being defined?
2) If I do need to define the server token, how is this done? What would dssendmail_template.txt look like if one had to use it?

Any help is appreciated,

Posted: Mon Jul 24, 2006 4:09 pm
by ray.wurlod
You can get this message on any failure to send, for example if the mail client is not running. That is, the problem is not necessarily in DataStage; "they" are trying to be helpful with diagnostic suggestions, too helpful perhaps, since it can be misleading. Of course, it could be that the job parameter values for sender, recipient, server name might not have been properly set; check the "job starting" message in the log to see what parameter values were used.

Posted: Mon Jul 24, 2006 4:53 pm
by crsimms
Ray,

The job parameter values for UtilityEmailMsgsSeq.J_FAA_Clear_Hash_Files as reported by the DataStage log look good:

SupportEmail=chris.simms@mkcorp.com
AbortingJob=J_FAA_Clear_Hash_Files
SubjectLine=Job J_FAA_Clear_Hash_Files aborted within Main_FAA

And if I execute the following script within the project directory:

#! /usr/bin/sh
/usr/lib/sendmail -t <<////
From: Chris.Simms@mkcorp.com
To: Chris.Simms@mkcorp.com
Subject: test

test body
////


I receive an email. I am not sure where DataStage is encountering an error. The command sendmail is accessbile and works and the DataStage parameter values seem ok. This event process is working withing other sequencers in another DataStage project on the same server.

This could drive a person nuts....

Posted: Mon Jul 24, 2006 9:44 pm
by ray.wurlod
Is it reproducible, or did it only happen once? If the latter, the mail client or server might have been off having a smoke or something at the time.

If it's reproducible, try simplifying what you are doing as much as possible, then add complexitiy a piece at a time till it breaks, so that you can identify the culprit. For example begin with hard coded fields and no attachments. Then add one job parameter at a time. And so on.

Posted: Tue Jul 25, 2006 10:31 am
by crsimms
Ray,

Ok...I have gotten it to work but with strange behaviors. If I define the Notification Activity parameters as follows:

Senders email address: #AbortingJob#
Recipients email address: #SupportEmail#
Email Subject: #RoutGetMessages.$ReturnValue#
Email body:

I receive the following email:

From: J_Create_Consultant_Org_Hash_Files3@server.mkcorp.com
To: Simms, Chris
Subject: J_Create_Consultant_Org_Hash_Files3
Body:

WARNING AND FATAL MESSAGES FOR JOB **J_Create_Consultant_Org_Hash_Files3**

WARNING
J_Create_Consultant_Org_Hash_Files3..Hash_Consultant_Org_CRC32_0.Hash_Consultant_Org_CRC32: DSD.UVOpen mkdbfile: cannot create file asdfasdfasdfasdfasdf/Hash_Consultant_Org_CRC32



This is fine, except for the fact I must set Email Subject to the return value of the RoutGetMessages call and leave Email body blank. If I initialize the stage as I believe a developer would normally do:

Senders email address: #AbortingJob#
Recipients email address: #SupportEmail#
Email Subject: #SubjectLine#
Email body: #RoutGetMessages.$ReturnValue#

I receive the following email:

From: J_Create_Consultant_Org_Hash_Files3@server.mkcorp.com
To: Simms, Chris
Subject: Aborting Job
Body:

#RoutGetMessages.#


I cannot access the return value of RoutGetMessages when setting the body as the external parameter helper cannot be accessed. Is there a designer patch that affects this stage that I need to install? I don't remember seeing hearing about one. In addition, I am still fuzzy about the functionality of the "Include job status in email" check box on the Notification page for the stage.

Thanks