Parameterizing Attached file path in DSSendmail routine

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
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Parameterizing Attached file path in DSSendmail routine

Post by shaonli »

Hi,

I want to attach a file in mail which I am sending from Datastage.I am using DSsendmail Routine.
There When I am explicitly giving Attached file path then the file is going in mail.
But when I am using Parameter in file path it is showing Cannot open file.

Arg:

"From:me@here\nTo:you@there\nSubject:Hi ya\nAttach:test/reject/AFile.txt\nBody:Line1"

when I am giving this the file is attached with mail,

But when I am giving the Argument in below foramts it is showning error Cannot open file

"From:me@here\nTo:you@there\nSubject:Hi ya\nAttach:$para_Rej/AFile.txt\nBody:Line1"

"From:me@here\nTo:you@there\nSubject:Hi ya\nAttach:#$para_Rej#/AFile.txt\nBody:Line1"

Can't it be parameterized.

Please suggest.

Thanks
Shaonli
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

Sorry the job is Parallel
Jasti
Participant
Posts: 44
Joined: Sat Apr 14, 2007 6:34 am
Location: Hyderabad, India

Post by Jasti »

I have also tried and failed to pass parameters in the fields From and To Addresses to DSSendmailTester Routine Activity and I feel that it can't be parameterized. :)

In case of notification stage also..viewtopic.php?t=121727
Thanks,
Mohan.A.Jasti.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

shaonli wrote:Sorry the job is Parallel
Sorry, the job is Sequence. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I've had no issues using Job Parameters in the Notification Activity for either email address, the subject nor the attachment, all happily support them. As noted and AFAIK the body doesn't but it's been a long time since I've tried that.

Your problem is the fact that you are passing in a literal string so none of your parameters get resolved. You can build the string outside of the call itself, concatenating the strings to the parameters so the resolved values get incorporated into the final string.
-craig

"You can never have too many knives" -- Logan Nine Fingers
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

Yes it has been possible by passing paramter outside DSsend Mail routine.The Argument is passed from Unix script.
in the argument if routine I am giving that value as Command Output.

So it has been possible to parameterized.

Thanks a lot..
:) Shaonli
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

Yes it has been possible by passing paramter outside DSsend Mail routine.The Argument is passed from Unix script.
in the argument if routine I am giving that value as Command Output.

So it has been possible to parameterized.

Thanks a lot..
:) Shaonli
Post Reply