Unable to send Email
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
Unable to send Email
Hi All,
I searched the forums related to this one but could not find a solution to my problem.
I have a parallel job retrieving reject records from a table in sql server to a file. I have an after job routine to email this file as an attachment after the retrieval is successful.
I am getting the following warning message
Test_Connection123..AfterJob (DSSendMail): The following tokens in the 'dssendmail_template.txt' file have not been set in the call to DSSendMail: %server%
The following is the code in my Afterjob Routine
Call DSLogInfo("Getting Reject File Information",DSJ.ME)
strDatapath = DSGetParamInfo(DSJ.ME, "$DATAPATH", DSJ.PARAMVALUE)
strRejectFileLoc = strDatapath:'\GenSys\Rejects'
strRejectFile = DSGetParamInfo(DSJ.ME, "JPM_SEQL_REJECT", DSJ.PARAMVALUE)
Call DSLogInfo("File":strRejectFile:" will be emailed to the client, if reject records exist",DSJ.ME)
*----Sending Mail to Business Users----*
FROM_MAILID = DSGetParamInfo(DSJ.ME, "JPM_FROM_MAILID", DSJ.PARAMVALUE)
TO_MAILID = DSGetParamInfo(DSJ.ME, "JPM_TO_MAILID", DSJ.PARAMVALUE)
Server_Name= DSGetParamInfo(DSJ.ME, "$MailServer", DSJ.PARAMVALUE)
ERROR_DIR = strRejectFileLoc
SUBJECT = "E-Mail Notification For Rejects"
If intNoRecReject >0 Then
Final_Attachment = ERROR_DIR:"\":strRejectFile
Result= DSSendMail("From:":FROM_MAILID:"\nTo:":TO_MAILID:"\nSubject:":SUBJECT:"\nAttach:":Final_Attachment:"\nBody:":"%report%":"\nServer:":Server_Name)
End
Any help is highly appreciated
I searched the forums related to this one but could not find a solution to my problem.
I have a parallel job retrieving reject records from a table in sql server to a file. I have an after job routine to email this file as an attachment after the retrieval is successful.
I am getting the following warning message
Test_Connection123..AfterJob (DSSendMail): The following tokens in the 'dssendmail_template.txt' file have not been set in the call to DSSendMail: %server%
The following is the code in my Afterjob Routine
Call DSLogInfo("Getting Reject File Information",DSJ.ME)
strDatapath = DSGetParamInfo(DSJ.ME, "$DATAPATH", DSJ.PARAMVALUE)
strRejectFileLoc = strDatapath:'\GenSys\Rejects'
strRejectFile = DSGetParamInfo(DSJ.ME, "JPM_SEQL_REJECT", DSJ.PARAMVALUE)
Call DSLogInfo("File":strRejectFile:" will be emailed to the client, if reject records exist",DSJ.ME)
*----Sending Mail to Business Users----*
FROM_MAILID = DSGetParamInfo(DSJ.ME, "JPM_FROM_MAILID", DSJ.PARAMVALUE)
TO_MAILID = DSGetParamInfo(DSJ.ME, "JPM_TO_MAILID", DSJ.PARAMVALUE)
Server_Name= DSGetParamInfo(DSJ.ME, "$MailServer", DSJ.PARAMVALUE)
ERROR_DIR = strRejectFileLoc
SUBJECT = "E-Mail Notification For Rejects"
If intNoRecReject >0 Then
Final_Attachment = ERROR_DIR:"\":strRejectFile
Result= DSSendMail("From:":FROM_MAILID:"\nTo:":TO_MAILID:"\nSubject:":SUBJECT:"\nAttach:":Final_Attachment:"\nBody:":"%report%":"\nServer:":Server_Name)
End
Any help is highly appreciated
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
Craig,
I agree with you on the quotes - I got the error message during the compilation of the routine but forgot to make the change in my submission here.
%report% - looks like the default variable defined in datastage that provides the report that is being generated in my job.
FYI - My job consists of generating a flat file with the rejected records. This is being added as the content/attachment
The following shows that the CSV file is being retrieved by the use of this.
Test_Connection123..AfterJob (DSSendMail): Cannot open attachment file 'e:\data\dev\GenSys\Rejects\Reject1.csv \nServer:ndhamrexm05.amer.pfizer.com'
I agree with you on the quotes - I got the error message during the compilation of the routine but forgot to make the change in my submission here.
%report% - looks like the default variable defined in datastage that provides the report that is being generated in my job.
FYI - My job consists of generating a flat file with the rejected records. This is being added as the content/attachment
The following shows that the CSV file is being retrieved by the use of this.
Test_Connection123..AfterJob (DSSendMail): Cannot open attachment file 'e:\data\dev\GenSys\Rejects\Reject1.csv \nServer:ndhamrexm05.amer.pfizer.com'
-
- Premium Member
- Posts: 19
- Joined: Tue Jul 28, 2009 1:53 pm
-
- Participant
- Posts: 63
- Joined: Mon Oct 20, 2008 12:01 am
- Location: Malaysia