Send email while rejecting Records
Moderators: chulett, rschirm, roy
Send email while rejecting Records
Hi,
i have a sequential file and i am inserting the records to the Target DB2 table and also have a reject link to throw out the rejected records.
I need an email when the records get rejected.How do i can do this in Datastage?
i have a sequential file and i am inserting the records to the Target DB2 table and also have a reject link to throw out the rejected records.
I need an email when the records get rejected.How do i can do this in Datastage?
After the job completes, you check the row count down the link or the size of the file and send an email if it has been written to. A Sequence job is probably best to control this but it could be done via an After Job routine or batch file.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
You can write a server routine to count the rows in reject link.
Design a sequence job like first your main job activity runs then e-mail notification activity stage.call a routine in job activity with custom condition option.
Design a sequence job like first your main job activity runs then e-mail notification activity stage.call a routine in job activity with custom condition option.
Thanks
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Actually you can do it while rejecting records, but do you really want to send a separate email for each record rejected? The recipient(s) will quickly begin to hate you if you do. Therefore I'll not be explaining the technique.
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.
Seriously? So if 200 records were rejected you'd like to send 200 separate emails?
Now you've got me curious. Since I would never implement any such thing, perhaps Ray can share with us the mailbomb technique? From a purely informational / educational standpoint, of course!
Now you've got me curious. Since I would never implement any such thing, perhaps Ray can share with us the mailbomb technique? From a purely informational / educational standpoint, of course!
-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:
That's a kinder approach.
The suggestions given earlier are appropriate - either a Routine activity in the controlling sequence to get the link row count on the reject-handling link followed by a Notification activity to send the email, or an after-job subroutine to do the same.
The mailbomb technique is a BASIC Transformer stage fed by the reject-handling link, with a call to a routine that invokes DSSendMail().
The suggestions given earlier are appropriate - either a Routine activity in the controlling sequence to get the link row count on the reject-handling link followed by a Notification activity to send the email, or an after-job subroutine to do the same.
The mailbomb technique is a BASIC Transformer stage fed by the reject-handling link, with a call to a routine that invokes DSSendMail().
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I thought you might have worked "Spamalot" into the thread somewhere there, Craig.
Especially as it's playing in Denver (Buell Theater) next week.
http://www.denvercenter.org/buy-tickets ... about.aspx
Especially as it's playing in Denver (Buell Theater) next week.
http://www.denvercenter.org/buy-tickets ... about.aspx
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.
-
- Participant
- Posts: 15
- Joined: Wed May 02, 2012 3:38 am
use the below procedure,
jobactivity -> Execute condition -> UV Activity -> neted condition -> notification mail
Execute condition:-
cd reject file path;cat reject file|wc -l (if u r not passing metadat)
UV activity > if nested condition.commnad o/p > 0 then 1 else 0
nested condition -> UV.activity = 1
then link to notification activity it will drop an e-mail.
oterwise u can directly hadle it in uv activity level by using routine DSSendmailwithsubject
Thanks,
jobactivity -> Execute condition -> UV Activity -> neted condition -> notification mail
Execute condition:-
cd reject file path;cat reject file|wc -l (if u r not passing metadat)
UV activity > if nested condition.commnad o/p > 0 then 1 else 0
nested condition -> UV.activity = 1
then link to notification activity it will drop an e-mail.
oterwise u can directly hadle it in uv activity level by using routine DSSendmailwithsubject
Thanks,
I do use a "spam generator" email job to send info messages to each office ( with a contact 'email list' thats vertically pivoted list of comma seperated email ids) if their records had a lookup failure - and I use exactly Ray's approach , but its a server job.
For a pure parallel approach , Im curious if an Unix Wrap stage ( Or External Filter ?? ) that calls mailx on a 'per row basis' can be made to work .
For a pure parallel approach , Im curious if an Unix Wrap stage ( Or External Filter ?? ) that calls mailx on a 'per row basis' can be made to work .