How to send an e-mail notification after 5 rows are rejected

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
robbie
Participant
Posts: 2
Joined: Tue Oct 11, 2005 8:59 am

How to send an e-mail notification after 5 rows are rejected

Post by robbie »

Hi all,
I have to implement a logic where in i will have to abort after 5 rows are rejected while i load into a target table. Can any one please help me out.
Thanks in Advance
logic
Participant
Posts: 115
Joined: Thu Feb 24, 2005 10:48 am

Post by logic »

If the rows are being rejected with a warning. modify settings of job to abort after 5 warnings. Use notification activity in sequence with exception handler.
Hope this helps :)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is effected in the same grid where you enter your output link constraint expressions in a Transformer stage. The fourth (rightmost) column in the grid is labelled "Abort After Rows". Put 5 against your rejects link. That's all you have to do to get the job to abort.

In its controlling job sequence you need to detect that condition (a Failure trigger), send your email and, ideally, run the job again with the run type "reset".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rangs
Charter Member
Charter Member
Posts: 6
Joined: Mon Mar 28, 2005 6:29 pm

Use DSSendMail routine

Post by Rangs »

I have done this..

D/S has a built in routine called DSSendMail. You can call this from the Derivation or constraints inside the transformer.

Eg From Derivation

If @OUTROWNUM > 5 Then DSSendMail(StageVar) Else InputLink.MappingCol

StageVar is /n seperated parameters consisting of your exchange server name, target user, originator etc. This is available in the DSSendMail Routine's Long Description

The output link can go to a dummy nul stage or a temporary hash file

Regards
Rangs
Post Reply