Unable to send mail using notification activity -job aborted

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
maypandh
Participant
Posts: 13
Joined: Mon Apr 18, 2016 8:37 am

Unable to send mail using notification activity -job aborted

Post by maypandh »

Hi All,

Scenario ::
I want to collect recipient addresses from a file then for those addresses which are mentioned in MailList file I want to send emails.

So I have created one shell script called through execute command activity which is fetching data from file & echoing output as mail addresses and passes as input to notification activity stage to send mail.

Job Flow ::

Execute Command Activity (For Fetching mails from a file & passing those mails as output) -- > Notification Mail Activity (Mentioned Command output in recipient mail address)

So For a sample file MailList.txt which is holding 2 addresses (Space separated)
abc.123@gmail.com xyz@gmail.com

Output From Command Activity Stage (From Script MailList.sh) is ::
abc.123@gmail.com xyz@gmail.com

Input to Notification Mail Activity ::
Recipients email address : #Execute_Command.$CommandOutput#

But Job is getting aborted stating Parameter 2 ('') does not start with a keyword.


Kindly suggest how to resolve this issue.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I believe the email addresses need to be comma separated with no space.
-craig

"You can never have too many knives" -- Logan Nine Fingers
maypandh
Participant
Posts: 13
Joined: Mon Apr 18, 2016 8:37 am

Post by maypandh »

In Notification Mail Activity stage while sending mails, in recipient addresses can be space separated.

As I have tested with only notification activity stage with space separated between mail ID's.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And yet passing that space separated list as a parameter may be problematic, hence my suggestion. Seems to me it's worth a shot, then you can come back here and tell me I was full of crap if it still doesn't work. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
maypandh
Participant
Posts: 13
Joined: Mon Apr 18, 2016 8:37 am

Post by maypandh »

Hi Craig,

I tried with comma separated but still facing same issue as Parameter 2 ('') does not start with a keyword.

Kindly suggest any alternative way.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I have no idea right now what exactly "Parameter 2" might be. Can you copy / paste the complete, unedited error message from the log here? I'd also be curious if your mechanism works at all with a single email address being passed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
JRodriguez
Premium Member
Premium Member
Posts: 425
Joined: Sat Nov 19, 2005 9:26 am
Location: New York City
Contact:

Post by JRodriguez »

Try cleaning up the output from the command in a user variable before passing to the email notification. The parameter2 (") might just be that the command output contain a field marker (@FM)
Julio Rodriguez
ETL Developer by choice

"Sure we have lots of reasons for being rude - But no excuses
maypandh
Participant
Posts: 13
Joined: Mon Apr 18, 2016 8:37 am

Post by maypandh »

Hi Julio,

I had already tried that option as to capture output from command output to a user variable then bypass that variable as a input to notification mail activity.

But still got same issue.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

How about a response to my last post?
-craig

"You can never have too many knives" -- Logan Nine Fingers
JRodriguez
Premium Member
Premium Member
Posts: 425
Joined: Sat Nov 19, 2005 9:26 am
Location: New York City
Contact:

Post by JRodriguez »

I guess that you also cleaned up the field markers -@FM- values in the user variable activity. Did you?

Convert(@FM,'', commandOutput)
Julio Rodriguez
ETL Developer by choice

"Sure we have lots of reasons for being rude - But no excuses
maypandh
Participant
Posts: 13
Joined: Mon Apr 18, 2016 8:37 am

Post by maypandh »

Hi Julio,

Thanks a lot !! :)

Given logic worked fine & able to send mails to different id's.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... should have pushed earlier on the @FM possibility but those usually end up throwing a "code=-4 [ParamValue/Limitvalue is not appropriate]" error message. I also thought when Julio first mentioned them and you said you "already tried that option" that you meant you'd already stripped out the Field Mark(s) that $CommandOutput always adds to the string. For the record, you would have had this problem using this mechanism to pass in any number of values, including a single email address.

Thanks for pushing the proper solution, Julio. :wink:
-craig

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