Conditional job abort

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

Post Reply
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Conditional job abort

Post by videsh77 »

Hi

In my Px job, after some condition in transformer is evaluated false, I want that DataStage job to abort. It should not execute further stages. Can someone suggest me what is the way out of this?

Thanks in advance.
Thanks with regards,
videsh.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Conditional job abort

Post by sud »

videsh77 wrote:Hi

In my Px job, after some condition in transformer is evaluated false, I want that DataStage job to abort. It should not execute further stages. Can someone suggest me what is the way out of this?

Thanks in advance.
Break your job into two jobs. First job sets the job status conditionally and according to the condition the second job is triggered. If you don't want to break up your job, you will have to use a basic transformer stage and call a basic routine which will abort the job.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

You can force a job to abort in a transformer by setting the 'Abort After Rows' field for a link on the constraints page. In your case add a link if you don't already have one with a constraint that is the condition you want to catch.

I don't think it is very good practice to force a job to abort and I have seen cases where this functionality does not abort the job because the signal is not detected before the job finishes. Can you achieve the desired outcome by checking the status of the job after it finsihes and counting the number of rows going down particular links?
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

We Can achieve your requirement by writing the Basic Routine and call that in After Subroutine box.

First thing is make the constraint as per your requirement in a new link called dummy link ( Condition is data='False') in that link just create a column called Dummy and direct to Copy stage and leave as it is. If your constrained satisfied with your input data then rows will go to the dummy link.

In the Basic routine use DSGetLinkInfo to get row count and write conditon that if that particular link have the rows more than 0 then abort the job and u can create Abort message also in your job by using DSLogFatal.

Hope it will be helpful......
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

The easiest method, without much custom coding, is thompsonp's method. This way will cause and immediate abort and prevent further stages to execute.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Yes, I used thomsomps method.

I set, 'Abort after rows = 1', for failure condition. It aborts the job.

Thanks.
Thanks with regards,
videsh.
Post Reply