DSSendMail - Syntax using variable as parameters

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
aluthra48
Participant
Posts: 66
Joined: Thu Mar 05, 2009 9:59 am

DSSendMail - Syntax using variable as parameters

Post by aluthra48 »

What is the syntax using variables as parameters in DSSendMail? I have tried the following and it does not work:

Recipients = ToList
Ans = DSSendMail("From:aaa.xxx.com\nTo:#Recipients#\nSubject:Job Failure\nBody:Hourly failed to load successfully\n")
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There are no parameters inside those double-quotes, they make them a literal string. You'd need to build it in pieces, text and parameters separately and then concatenate things together. For example:

Ans = DSSendMail("From:aaa.xxx.com\nTo:":#Recipients#:"\nSubject:Job Failure\nBody:Hourly failed to load successfully\n")
-craig

"You can never have too many knives" -- Logan Nine Fingers
bi_fujitsu
Premium Member
Premium Member
Posts: 46
Joined: Tue Mar 20, 2007 3:30 am
Location: India

Post by bi_fujitsu »

MailArg<-1> = "To : " : VarToAddress
MailArg<-1> = "From : " : VarFromAddress
MailArg<-1> = "Subject : " : VarSubject
MailArg<-1> = "Server : " : VarServer
MailArg<-1> = "Body : " : VarMsgBody


Code = DSSendMail(MailArg)

This is how we have to parameterize the email notification function.
Post Reply