E-mail Notification (Attaching a .txt/html file)

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

E-mail Notification (Attaching a .txt/html file)

Post by DSFreddie »

Hi All,

I am trying to attach a .txt & .html (in 2 different e-mail notification activity). The files look in good format (like below) when i ftp'd & opened with notepad.

Process Date : 20120308
Total Adds : 0
Total Changes : 0
Total Deletes : 0
Total Suspects : 6880

But when the email notification attach this file, it is converted to a single line as below, (this report is generated through LINUX scripting)
Process Date : 20120308 Total Adds : 0 Total Changes : 0 Total Deletes : 0 Total Suspects : 6880

Any thoughts will be helpful.

Thanks in advance
Freddie
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Create the file with DOS line terminators.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Post by DSFreddie »

Hi Chulett,

Thanks for your reply.

I googled for more info on DOS line terminators, but couldnt find any info on the same. Can you pls shed some light on this.

Thanks
Freddie
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

When you are FTP'ing, you are likely transferring in ASCII mode which converts the UNIX newline to the Windows newline which is why that looks fine.

Craig's suggestion is to generate the file with a CRLF rather than just a LF. In DataStage terms this is a case of using the end of record terminator string set to DOS terminator string in your target sequential stage.
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Post by DSFreddie »

Thanks for your reply Kryt0n.

Pls note that I am building this report through a LINUX Shell Script. ( & not through Filestage in DS). Wondering whether we can add DOS line terminator in Script level too.

Thanks
Freddie
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You should have a couple of LINUX commands to change terminators in a file - dos2unix and unix2dos - use the latter after the file is created.
-craig

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