Email Problems

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
jshurak
Participant
Posts: 74
Joined: Mon Jan 09, 2006 12:39 pm

Email Problems

Post by jshurak »

I'm trying to write a test email job that will read an array of email addresses from an external text file. The code is as follows.
EMail = ''

*** Find out what AS/400 the file will be extracted from ***
OpenSeq "G:\DataStage\DStage_Data\TEST_Email_Control.txt" To INLINE Then
Read:
ReadSeq DataLine from INLINE Then
EMail = Trim(DataLine)
hJob1 = ''
Status = ''
StartTime = ''
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
StartTime = DSGetJobInfo(hJob1, DSJ.JOBSTARTTIMESTAMP)
END
CloseSeq INLINE

message = ""
sender = "From:Data_Staqe_Dwetl2@appliedcard.com\n"
message = message:"This is a test\n"
For L = 1 to COUNT(EMail,@AM)+1
EMailMessage = ""
EMailMessage = sender
EMailMessage = EMailMessage:EMail<L>
EMailMessage = EMailMessage:message
code = ''
code = DSSendMail(EMailMessage)
If code = 0 Then
Call DSLogInfo("E-mail sent successfully.",'Job Control')
End Else
Call DSLogInfo("E-mail NOT sent.",'Job Control')
End
Next L
I am getting the following warning:
Email_Test..JobControl (DSSendMail): Parameter 3 ('"This is a test') does not start with a keyword
I am having trouble figuring out what keyword datastage is looking for.

any help would be greatly appreciated.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Re: Email Problems

Post by DSguru2B »

jshurak wrote: message = ""
sender = "From:Data_Staqe_Dwetl2@appliedcard.com\n"
message = message:"This is a test\n"
Probably this is the piece you are getting your warning. I think you are Concatinating the message with " This is a test\n".
Try this instead.
message = "This is a test\n"
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jshurak
Participant
Posts: 74
Joined: Mon Jan 09, 2006 12:39 pm

Post by jshurak »

message = "This is a test\n"


I had it setup like that before. I tried it again but to no avail
Post Reply