Mailing file contents

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
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Mailing file contents

Post by vinothkumar »

Hi,
I am creating a file at the end of my job. After it is created I want to send this file through e-mail. Instead of sending as attachments I want the file contents to come under my Email body. How can I do ? Please advise.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll have to "roll your own" for that, script something using your tool of choice - sendmail, mailx, blat, whatever is in use there that supports that option to "inline" your file.
-craig

"You can never have too many knives" -- Logan Nine Fingers
JRodriguez
Premium Member
Premium Member
Posts: 425
Joined: Sat Nov 19, 2005 9:26 am
Location: New York City
Contact:

Post by JRodriguez »

The body of the email notification activity don't allow parameters :(

But if you would like to used a server job then try below using DSSendMailTester utility:

The job design looks like this : Folder Stage --> Transformer --->Seq File

Read your file with a folder Stage, the content of the file will be in the "Record" column, in the transformer call utility DSSendMailTester( To address, From address, Subject line, Server name, Message body) as a derivation to a dummy or log column in the sequential file. Map the "Record" column to the Message body argument , rest of argument could be parameters

Let us know your results
Julio Rodriguez
ETL Developer by choice

"Sure we have lots of reasons for being rude - But no excuses
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Yeah it is working.. Thanks a lot..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, that's an interesting solution. :wink:

I would simply script something to run 'after job'. Or if I was going to use that routine, I would create a copy of it and name it something more appropriate: DSSendMailInline or some such. More... "future proof" that way I would think as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rsiem
Premium Member
Premium Member
Posts: 27
Joined: Thu Aug 02, 2007 10:31 am

Post by rsiem »

I prefer to use mutt :

mutt -a attachment.ext -s subject user@domain.com </dev/null

:) easy as pie...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

True... they all suck but mutt sucks less. :wink: Blat is just as easy.
-craig

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