file attachment in mail
Moderators: chulett, rschirm, roy
file attachment in mail
Hi ,
Iam able to send mails using DSSendMail routine. I have a requirement of attaching a file which contains rejected records and send mail to clients ID. The file is getting attached, but it is not in readable format. It is just showing some squares as data. I am writing the rejected records to a txt file in datastage using sequential file stage. And Iam attaching the same file using DSSendMail after job subroutine.
DSSendMail("From:xx@yy.com\nTo:dd@zz.com\nSubject:Test Mail\nAttach:/xx/tt/xx/temp.txt\nBody:Hi%report%");
Plz let me know what the problem is.
regards,
ssunda.
Iam able to send mails using DSSendMail routine. I have a requirement of attaching a file which contains rejected records and send mail to clients ID. The file is getting attached, but it is not in readable format. It is just showing some squares as data. I am writing the rejected records to a txt file in datastage using sequential file stage. And Iam attaching the same file using DSSendMail after job subroutine.
DSSendMail("From:xx@yy.com\nTo:dd@zz.com\nSubject:Test Mail\nAttach:/xx/tt/xx/temp.txt\nBody:Hi%report%");
Plz let me know what the problem is.
regards,
ssunda.
-
- Participant
- Posts: 54
- Joined: Wed Oct 25, 2006 11:07 pm
- Location: Hyderabad
Re: file attachment in mail
Hi,
DSSendMail function often gives error of these kind. Instead why dont you use the Notification Activity. It works really good
DSSendMail function often gives error of these kind. Instead why dont you use the Notification Activity. It works really good
If using version 7.5x , you can use mail attachment tester
Routines->Built-In-->Utilities.
It works pretty okay for some of my jobs
Code: Select all
DSSendMailAttachmentTester
It works pretty okay for some of my jobs
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
Re: file attachment in mail
I had a little different problem , the file attachment was failing because the file was locked.and hence was not able to send it. So as a work around I removed the after job subroutine and added a hashed file which sourced from the sequential file and then after that hashed file added one more transformer and used the routine in the Transformer to send this file. As the Seq file is locked till the hashed file is loaded but the mail routine will not get kicked till the hashed file is loaded completely so it waits. After the file is loaded the SEQ file is release and hence i was able to send it. well My requirement was to send the file on a particualr condition so I had to do this all , you can simply use the Notification Activitiy.
hi deepak,
Iam able to attach file in mail. Iam receiving that mail with file attached. But the problem is all records are being sequentially placed instead of writing 1 record on each row. And in b/w the records, there is one speical character(a square). appering in the text file.I tried with all delimiter options ,still Iam unable to getrid of that special character.
The data in the original file is as below:
"0"
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
But in the file that im getting thru mail, all the numbers are continuously placed with squares in between. The new line in the file is being placed as a square.
regards
ssunda
[/img]
Iam able to attach file in mail. Iam receiving that mail with file attached. But the problem is all records are being sequentially placed instead of writing 1 record on each row. And in b/w the records, there is one speical character(a square). appering in the text file.I tried with all delimiter options ,still Iam unable to getrid of that special character.
The data in the original file is as below:
"0"
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
But in the file that im getting thru mail, all the numbers are continuously placed with squares in between. The new line in the file is being placed as a square.
regards
ssunda
[/img]
Hi chulett,
You are right. we are creating files on unix and emaling to windows. I think I will not be able to create DOS files as the server on which our Datastage is working is on unix operating system.
Any other options that will enable us to view the data properly??
thanx in advance,
regards,
ssunda
You are right. we are creating files on unix and emaling to windows. I think I will not be able to create DOS files as the server on which our Datastage is working is on unix operating system.
Any other options that will enable us to view the data properly??
thanx in advance,
regards,
ssunda
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Just change the terminator property (Stage properties) from UNIX-style to DOS-style. This will put CRLF instead of LF at the end of each line.
Having just noticed that you are using parallel jobs, please ignore the previous advice. Instead, use 010 as the final delimiter character.
Having just noticed that you are using parallel jobs, please ignore the previous advice. Instead, use 010 as the final delimiter character.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Actually, what I said was you are creating a UNIX file, not creating files on UNIX. Different thing and as Ray noted, it's all about the record terminator you've chosen in the stage. Change it to 'DOS' so it uses CR/LF pairs rather than just the LFs that UNIX needs.ssunda6 wrote:You are right. we are creating files on unix and emaling to windows.
Granted, it will look a little funky on your UNIX server, but should sort out the 'problem' with the attachment.
Ok... '010' not 'DOS' then for a PX job.
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
ssunda, please fork over a mere 14 cents per day ($49 per year) so that you can read premium posts, and help us to fund this site. You don't want it to disappear, do you?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.