How to abort job based on constraint

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create another output link from the Transformer. Its constraint is the logical inverse of the constraint you have been using. On this link set Abort After Rows to 1. The link can connect to a Copy stage with no output. This will consume the row if it gets that far.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

ray.wurlod wrote:Create another output link from the Transformer. Its constraint is the logical inverse of the constraint you have been using. On this link set Abort After Rows to 1. The link can connect to a Copy ...
Hi Ray,

Its a good idea to capture the rows to another link and abort the job.

Here my doubt is if it has only one row, what will be the position, is it aborts the job ?

I have one more requirement like abort the job based on constrtaint and set a customised fatal error in the log (like job aborted because of a not equal to b ), in this scenarios what will we have to do ? is there any built in function to do this ? or we have to use any logice for that ?

Thanks.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try it and see.

(One row does abort the job. But don't take my word for it - a test job would take less than two minutes to create.)

Your additional requirement is not part of the original question, but could easily by solved by creating a column derivation or even constraint expression on the second output link that included a call to DSLogFatal().

As you may have read elsewhere, I do not believe in jobs aborting under any circumstances. Then, when they do, it has to be an environmental factor, such as database not available. Even then, you can test for that with an innocuous job before starting the real work.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chalasaniamith
Participant
Posts: 36
Joined: Wed Feb 16, 2005 5:20 pm
Location: IL

Post by chalasaniamith »

right couple of mins for test job thanks ray for you time :)
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

Hi Ray,

Thanks for your valuable suggestions. I will try what ever you said and let dsxians know the result of my job.

Thanks once again.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
chalasaniamith
Participant
Posts: 36
Joined: Wed Feb 16, 2005 5:20 pm
Location: IL

Post by chalasaniamith »

Thanks for every one splly to Ray...

It was resolved by keeping the copy stage from transformer and the option for the link abort after rows worked excellent and its aborting the job.

file-> tx->file
|
copystage->file

thanks
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
Post Reply