Page 1 of 1

DSSendMail syntax question

Posted: Fri Dec 21, 2007 10:41 am
by RodBarnes
I am using DSSendMail as an after-job subroutine. Mostly, it works correctly but when I attempt to have it send an attachment, it reports:
  • Cannot open attachment file 'D:\Ascential\DataStage\Staging\Orbit_rod\seqCompliance\Rejects\UnknownBase.csv'
Which is the correct path and filename. I can confirm the file is there and I can open it.

The statement I am using is found below.

Code: Select all

From: #jpSequence#@datastage.adp.com\nTo: #jpSmtpRecip# #jpSmtpCopy#\nSubject: (#jpOrbitServer#.#jpOrbitUserId#): Unknown system bases\nServer: #jpSmtpHost#\nAttach: #jpFilePath#\#jpProject#\#jpSequence#\Rejects\UnknownBase.csv\nBody: The attached file contains the list of systems that show an unknown OS or Hardware base.
If I remove the "Attach" segment (below), it works fine.

Code: Select all

From: #jpSequence#@datastage.adp.com\nTo: #jpSmtpRecip# #jpSmtpCopy#\nSubject: (#jpOrbitServer#.#jpOrbitUserId#): Unknown system bases\nServer: #jpSmtpHost#\nBody: The attached file contains the list of systems that show an unknown OS or Hardware base.
Can anyone point me to a reason why the file would not be accessible?

Posted: Fri Dec 21, 2007 1:15 pm
by ray.wurlod
What are the values (from the "job starting" log message) for the job parameters jpFilePath, jpProject and jpSequence ?

Posted: Fri Dec 21, 2007 1:45 pm
by RodBarnes
I just took at closer look at the message and there is a leading space between the (') and the "D:\Ascential..." I guess it needs to not have spaces between the tokens and the values. Removed them and it worked.

Thanks for your reply, Ray.