sending mail from a param file in datastage

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
pragb
Participant
Posts: 10
Joined: Sat Jul 16, 2011 5:18 am
Location: Pune
Contact:

sending mail from a param file in datastage

Post by pragb »

Hello All,

I am having issue in sending mail notification through datastage.

the design of my sequence is as follows

execute command stage-----User variables_Activity---Notification activity

In execute command stage I am trying to read the param file through cat command,the file consists of few email addresses,I need to send mails to them If my job aborts.

But I am struggling to pass proper email addresses in the receiver's list in the notification activity.In the user variable activity stage I have used Oconv function but that is not giving me the desired result.

Can you please suggest what else I can try?

Many thanks in advance.

Regards,
Pragb
ankursaxena.2003
Participant
Posts: 96
Joined: Mon May 14, 2012 1:30 pm

Post by ankursaxena.2003 »

Use the following code in User Variable Activity will get all the email address in the Email_List User Variable

UserVariables_Activity_89
Email_List : Field(Convert(@FM, "", ExecCommand.$CommandOutput),'',1)

And then in the Mail Notification activity in the Recipient Email Address write the following code:

#UserVariables_Activity_89.Email_List#
bhasds
Participant
Posts: 79
Joined: Thu May 27, 2010 1:49 am

Post by bhasds »

Hi Pragb,

To get rid of this problem you can use the tr -d '\n' command in execute command activity. For example, if you are using the command cat filename in execute command then it should be-

Code: Select all

cat filename | tr -d '\n'
Now the output from the execute command should wok fine for the notification activity.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's what converting @FM to "" achieves.
:wink:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pragb
Participant
Posts: 10
Joined: Sat Jul 16, 2011 5:18 am
Location: Pune
Contact:

Post by pragb »

Hi,

This is resolved.

Many thanks

Pragb
Post Reply