Dynamic email body & send with Notification Activity
Moderators: chulett, rschirm, roy
Dynamic email body & send with Notification Activity
Hi,
I need to create a job where I make up an email body based on data from 2 different SQL extractions (but from the same source) I receive.
Examples of each piece of data I am extracting:
Data1
Module | Message | Source
-------------------------------------
France | Success | File1
UK | Success | File2
Data2
Module | Message | Reason | Source
----------------------------------------------------------
Spain | Fail | Missing number | File3
Germany| Fail | Missing name | File4
The final format I would like (based on the data above) in the email will be
Successful
---------------
France (File1)
UK (File2)
Fail
--------------
Spain - Missing number (file3)
Germany - Missing name (file4)
Can I actually do create an email body within DataStage like that and pass it to the DSSendEmail routine?
I have been using VBScript to do the above but now required to use DataStage to do it and I am clueless how this can be done. Any suggestion will be appreciated. Thanks
I need to create a job where I make up an email body based on data from 2 different SQL extractions (but from the same source) I receive.
Examples of each piece of data I am extracting:
Data1
Module | Message | Source
-------------------------------------
France | Success | File1
UK | Success | File2
Data2
Module | Message | Reason | Source
----------------------------------------------------------
Spain | Fail | Missing number | File3
Germany| Fail | Missing name | File4
The final format I would like (based on the data above) in the email will be
Successful
---------------
France (File1)
UK (File2)
Fail
--------------
Spain - Missing number (file3)
Germany - Missing name (file4)
Can I actually do create an email body within DataStage like that and pass it to the DSSendEmail routine?
I have been using VBScript to do the above but now required to use DataStage to do it and I am clueless how this can be done. Any suggestion will be appreciated. Thanks
Last edited by dylsing on Mon Jul 03, 2006 6:28 am, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not without a routine somewhere in there, to build and send the email. The Notification Activity can not take an expression as the message body (though attachments are supported in version 7.5, so you could have the job produce the attachment file).
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.
Just to add on, I have thought of saving the rows into a sequential file and use the Space character as a delimiter so that the contents in the sequential file will be:
France (File1)
UK (File2)
Can I use any of the stages to transfer all the contents of the sequential file (including the new line characters that separate each row) as a single string output into the email body of the Notification Activity or DSSendMail?
France (File1)
UK (File2)
Can I use any of the stages to transfer all the contents of the sequential file (including the new line characters that separate each row) as a single string output into the email body of the Notification Activity or DSSendMail?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Just saw your email whilst I was posting. That's what I thought too, think I will have to explore just a bit more before giving this verdict to the client.ray.wurlod wrote:Not without a routine somewhere in there, to build and send the email. The Notification Activity can not take an expression as the message body (though attachments are supported in version 7.5, so yo ...
So when you use "cat" in shell script, it will return a concatenated value of the contents of the text file to your "Notification Activity"?kommven wrote:If I were you, I will write what I need to a file (using a shell script maybe) and cat it in subject in "Notification Activity"
`cat mystatusFile.txt`
Try it it works for me...
Kommven-
'cat' will only display the contents of the file. If the file has the values concatenated together then yes it will, but thats in the unix world. Your on windows. I suggest coding all this in a basic routine. You code everything to get it in a way you want and then call the DSSendMail() function. Read about its format in DS help.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 66
- Joined: Wed Mar 05, 2003 6:03 pm
- Location: Brisbane, Australia
- Contact:
In Windows the 'TYPE' command behaves the same as 'cat' in unix
Code: Select all
C:\>help type
Displays the contents of a text file or files.
TYPE [drive:][path]filename
Cameron Boog