Email Notification Stage Issue

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
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Email Notification Stage Issue

Post by devidotcom »

Hi All,

I have a email notification stage in the sequence thats sending an attachement to the user. The job aborts with the following message.

When i re-run the job again it runs to success and sends the attachment. Any issue with the stage due which this happens? Please advice.

PRS_STG_S_ERROR_STATS.CANADA_DAILY.JobControl (DSSendMail): Error when executing command: /dsproj001/is8/Projects/PPP_US/sendmail_PRS_STG_S_ERROR_STATS_5532000_11964.sh
*** No output from command ***
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: good4@gmail.com
To: good4@gmail.com
Subject: Error and Reprocess Records of Schedule CANADA_DAILY for Batch Number: 152
Content-Type: multipart/mixed; boundary=Unique-Boundary-15665-5532

This is a MIME encoded message.

--Unique-Boundary-15665-5532
Content-Type: application/octet-stream; name="CANADA_DAILY_Err_Rep_Count_152_2010-11-20.txt"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="CANADA_DAILY_Err_Rep_Count_152_2010-11-20.txt"


U0NIRU1BX05BTUV8VEFCTEVfTkFNRXxCQVRDSF9OVU18RVJSX1JFUF9DT1VOVApSQklfVUNf
RE18RSREX0xDVE5fSElFUnwxNTJ8MTMzClJCSV9VQ19ETXxFJERfTE9PS1VQfDE1MnwxMTYK
UkJJX1VDX0RNfEUkRF9PUkdfSElFUl9ISVNUfDE1MnwyMTkKUkJJX1VDX0RNfEUkRl9HTF9P
RkxOX0RUTHwxNTJ8MjMwMQpSQklfVUNfRE18RSRGX09SR19JVEVNX0xDVE5fUE9TTnwxNTJ8
Mjk4NDQ3MDMKUkJJX1VDX0RNfEUkRF9JVEVNX0hJRVJfSElTVHwxNTJ8MTUyOTkKUkJJX1VD
...(file truncated)...


PRS_STG_S_ERROR_STATS.CANADA_DAILY.JobControl (@Notify_Failure): Routine DSSendMail did not finish OK, return code = '-21'


PRS_STG_S_ERROR_STATS.CANADA_DAILY.JobControl (@Notify_Failure): Controller problem: Unhandled failure (-21) encountered calling routine DSSendMail


01:32:12: Notify_Failure (ROUTINE DSSendMail) started
01:32:14: Notify_Failure finished, reply=-21
01:32:14: Exception raised: @Notify_Failure, Unhandled failure (-21) encountered calling routine DSSendMail
01:32:14: Sequence failed (restartable)

Thanks,
Devi
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Any help on this issue... :(
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmmm... all the -21 means is "error when executing external command" so not all that helpful. Are you using attachment option built into the stage or doing something else?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I would turn on echoing commands and output in your shell script. There are various means to do this, search Google for "debugging shell script {YourUNIXFlavor}" to see which options are open to you on your platform.
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Well, I used the attachement option:
Please see below with the values given.

Senders email address:
good4@gmail.com

Recipient email address:
good4@gmail.com

Email Suject: Error and Reprocess Records of Schedule #jp_SchdName# for Batch Number: #$UDV_BATCH_NUM#

Attachments:
#$UDV_INPUT_DIR#/#jp_SchdName#_#Set_User_Variables.ScriptErrorFileNameonly#_#$UDV_BATCH_NUM#_#Set_User_Variables.CurrentDate#.txt
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

OK... time to put Arnd's suggestion to work.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply