DSsendmail Special Characters Issue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jlock23
Participant
Posts: 18
Joined: Wed May 11, 2005 9:16 am

DSsendmail Special Characters Issue

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: DSsendmail Special Characters Issue

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
jlock23
Participant
Posts: 18
Joined: Wed May 11, 2005 9:16 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jlock23
Participant
Posts: 18
Joined: Wed May 11, 2005 9:16 am

Post 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!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yeah! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply