Warning while sending a Email using DSSendMail

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
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Warning while sending a Email using DSSendMail

Post by sudharsanan »

Hello Gurus,

Today i created a job where i send a E-mail to me and my project mates as and when a job gets completed.. Now when the job gets completed i get a warning in director:"SeqLoadHash..JobControl (DSSendMail): Parameter 1 ('0') does not start with a keyword".. but the mail was actually sent to everyone... i am sending a e-mail by calling the DSSendmail Built-in Routine.. I gave the following details in the Routine stage...DSSendMail"From:XX@yahoo.com\nTo:yyy@yahoo.com\nSubject:Hi ya\nBody:JobHashedCompleted\n%report%").. is there something wrong with my parameter.. any help?...

Thanks
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
search for the DSSendMailTester routine in the built in routines.
it is a wraper routine for the DSSendMail that gets parameters for each section seperatly.
I bet you'll find it usefull.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Post by sudharsanan »

Roy,

I tried that routine also it asks for all the values like from,to,body,SMTP Server.. i gave all the values but when i tried to complie the job i get the following error..

Compiling: Source = 'RT_BP5160/JOB.2017379336.DT.1354017781', Object = 'RT_BP5160.O/JOB.2017379336.DT.1354017781'
********************************************************************************************?********
0073 p$12$1 = (XX@abc.com)
^
Variable Name (UNDEFINED) unexpected, Was expecting: Array Name,
CALLable Variable Name, DIMENSIONable Array Name, Variable name,
New variable name, Expression, "RPC_CALL"
0074 p$12$2 = (XX@abc.com)
^
Variable Name (UNDEFINED) unexpected, Was expecting: Array Name,
CALLable Variable Name, DIMENSIONable Array Name, Variable name,
New variable name, Expression, "RPC_CALL"
WARNING: Variable 'XX' never assigned a value.
WARNING: Variable 'Hai' never assigned a value.
WARNING: Variable 'This' never assigned a value.
WARNING: Variable 'is' never assigned a value.
WARNING: Variable 'a' never assigned a value.
WARNING: Variable 'test' never assigned a value.
WARNING: Variable 'mail' never assigned a value.
WARNING: Variable 'n%report%' never assigned a value.

2 Errors detected, No Object Code Produced.
(SeqLoadHash)

I could not even complie the job..do i have to put the values in some format.. does anyone has tried this routine....please help..

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, you are not meant to compile it, simply to Test it and see what results it gives on your system.

Any reason why you are not using the Notification Activity stage? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Post by sudharsanan »

I am not compiling the routine i am compiling the my job.. that time only i am getting this problem.. i don't know much about the notification stage...can you give some more info on this stage?. so that i can try this.. my requirement is to send a mail when a particular job is completed.. so it can do by any option.. i am planning to try sending mail from the UNIX box.. where i will write a shell script to send a mail and i can call this shell script in the BEFORE/AFTER stage of my job..which one will be effective datastage or UNIX ..can some one throw light on this?.. i am some what confused at this moment?.. please help...

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, I thought you said you were trying to compile the DSSendMailTester routine. That is what I was referring to when I said you can 'test' it to see if you can send email from DataStage. And DataStage uses 'sendmail' on UNIX under the covers to do the actual work, so no difference there.

If you are using Sequence jobs to run your Server jobs, then it should be trivial to send an email when the job completes. Simply run a link to the Notification Activity stage and fill in the blanks. No need for special routines or shell scripts... unless you need something it can't provide, like being able to send a true attachment with the email.

If you don't want to use Sequencers, then yes you'll need to write routines and/or shell scripts to accomplish your goal.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Post by sudharsanan »

No problem Chulett... I am using sequence jobs in my design.. I will try to use the Notification stage in my job..and use that option to send a mail and i will give the results to everyone...

Thanks
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

Based on the warning messages, I think you need to quote your arguments. Although, I agree with Craig, the NotificationActivity stage is the preferred approach.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That set of error messages results from not wrapping the message in quotes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Post by sudharsanan »

Thanks to Ray,Smith and other for helping me..but unfortunately i am getting the same issue, now i gave quotes to all the field in DSSendMailTester routinue, my job got compiled successfully...but when i run the job i getting the same exception again "SeqLoadHash..JobControl (DSSendMail): Parameter 1 ('0') does not start with a keyword".. i think that i am making some mistakes with the parameters.. has anyone faced like this before?..has anyone tried sending e-mail from Datastage..if so how?.. please explain...

Thanks
dsxuserrio
Participant
Posts: 82
Joined: Thu Dec 02, 2004 10:27 pm
Location: INDIA

Post by dsxuserrio »

Sudharshan
Please check your syntax again. Probably you left out a ( or some other character.
dsxuserrio

Kannan.N
Bangalore,INDIA
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Post by sudharsanan »

Hi,

The following are the values that i give to the DSSendMailTester

1.ToAddress -'xx@abc.com'
2.FromAddress -'xx@abc.com'
3.Subject--'Hai this is a test mail'
4.SMTPServer-'11.1.4.45'-- My SMTP Server IP Address
5.MessageBody-'Body:JobHashedCompleted\n%report%'---

I don't think that there is an ( or some other character in my values..it looks like a bug somewhere or am i giving some wrong values.. please help me in resolving this..

Thanks
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Post by sudharsanan »

Thanks to everyone the issue got resolved.. there was two calls to DSSendMail routinue, i modified in only one place..that why i was getting the warning.. Sorry for the confusion...Thanks
Post Reply