Page 1 of 1

DSsendmail Special Characters Issue

Posted: Mon Sep 15, 2008 12:05 pm
by jlock23
I have a after job subroutine which sends out emails. It sends out a link to a file for our customers to view.

We are moving from DataStage 7.1 Server Edition to DataStage 7.5 Parallel Edition. The routine has always worked correctly on the server edition.

Here is the code:

Code: Select all

      code = DSSendMail("from:DATASTAGE@spt.com\nto:myemail@address.com\nSubject: Statistics\nBody:This report shows the latest Statistics.  Please do not reply to this email address.  This email was generated by an automated system.\n \nReport can be found at: \\servername\$cldirectory\subdirectory\Stats.xls\n \n")
The filename that comes in the email that is sent out, looks like this:
\servername$cldirectory\subdirectory\Stats.xls

If I add an additional \ at the begining of the filename that is passed in (\\\servername\$cldirectory\subdirectory\Stats.xls), it results in:
\\servername$cldirectory\subdirectory\Stats.xls

If I also add an additional \ near the $ (\\\servername\\$cldirectory\subdirectory\Stats.xls), it results in:
\\servername\\$cldirectory\subdirectory\Stats.xls

If I add a / near the $ (\\\servername\/$cldirectory\subdirectory\Stats.xls), it results in:
\\servername\subdirectory\Stats.xls

If I add a / before the \ near the $ (\\\servername/\$cldirectory\subdirectory\Stats.xls), it results in:
\\servername/\$cldirectory\subdirectory\Stats.xls

Which WORKS...but it's weird looking. Can someone tell me how the DSSendmail routine is different on enterprise 7.5 from server 7.1 and if there is something I can do to make this look correct?

Re: DSsendmail Special Characters Issue

Posted: Mon Sep 15, 2008 12:33 pm
by chulett
jlock23 wrote:Can someone tell me how the DSSendmail routine is different on enterprise 7.5 from server 7.1 and if there is something I can do to make this look correct?
I really don't believe there is anything different as it's just an interlude to sendmail as the O/S level. For grins, what exact 7.5.x version did you upgrade to? What O/S?

Posted: Mon Sep 15, 2008 12:42 pm
by jlock23
7.5x2

We're moving from a Windows 2003 server to a Linux server (not sure about a version on the Linux)

You explanation makes sense though. So...it would a difference between the two O/S sendmail functions.

Posted: Mon Sep 15, 2008 1:09 pm
by chulett
7.5x2 is a Windows version and is quite old and... quirky. Surely you've got something more recent for UNIX - 7.5.1A, 7.5.2, 7.5.3 if you haven't gone to 8.x? :?

And the change in behaviour is understandable now that you are fundamentally changing the O/S at the same time - sendmail is used for all UNIX platforms, but with Windows? Something else entirely.

Posted: Mon Sep 15, 2008 1:47 pm
by jlock23
Thanks for the help. After investigating the sendmail command for linux. I determined that I needed to escape the $ with a \

And I needed to escape the \ with another \


So: \\\servername\\\$cldirectory\subdirectory\Stats.xls, results in:
\\servername\$cldirectory\subdirectory\Stats.xls

Which is what I wanted! Yeah!

Posted: Mon Sep 15, 2008 2:24 pm
by chulett
Yeah! :wink: