Issue with UtilitySeqEmailAndAbort

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
crsimms
Charter Member
Charter Member
Posts: 21
Joined: Mon May 30, 2005 4:21 am
Contact:

Issue with UtilitySeqEmailAndAbort

Post 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,
Chris Simms

Mobile: +972 989 0919
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
crsimms
Charter Member
Charter Member
Posts: 21
Joined: Mon May 30, 2005 4:21 am
Contact:

Post 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....
Chris Simms

Mobile: +972 989 0919
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
crsimms
Charter Member
Charter Member
Posts: 21
Joined: Mon May 30, 2005 4:21 am
Contact:

Post 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
Chris Simms

Mobile: +972 989 0919
Post Reply