How to abort a job?

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
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

How to abort a job?

Post by kumar_s »

Hi DSXians,
May i know the way to abort a job based on a calculaiton (probably from a transformer). Like a UtilityToAbortLog() available in server.
Is there any built in routines or functions available.

I need to calculate number of reject records and at once if it exceed 2% of source, it should be aboted

regards
kumar
dsusr
Premium Member
Premium Member
Posts: 104
Joined: Sat Sep 03, 2005 11:30 pm

Re: How to abort a job?

Post by dsusr »

Hi Kumar,

You can use the same utility by using the Basic Transformer in your parallel canvas but you need to pass the number of records in source as a parameter to the job.

Then you can implement the logic by using stage variables in the transformer.

Regards
dsusr
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi dsusr,
I understand that, but the whole point of aborting the job before it get finished is to make the job more effecient (to lower the run time). But as we know, Basic transformer is not the suitable stage in PX as for as effeiceny is concern :roll: .

regards
kumar
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

This is not only to abort the job, it would be better if it is possible to stop the whole flow once it reaches the condition....

regards
kumar
Amit Jaiswal
Premium Member
Premium Member
Posts: 38
Joined: Fri Apr 22, 2005 6:07 am

Use Abort After rows

Post by Amit Jaiswal »

Hi Kumanr,
You can call shell command wc -l to count number of rows in source if it is a sequential file (equivalent for other) using Before-Stage. This number you can use to determine %age of failure. Then inside a Transformer Stage take one stage variable in which you can write your logic and return a flag based on your requirement. Take this flag as a constraint for any link and specify Abort after rows as 1 or as per your requirement in the Constraint dialogue box.
Hope this will work for you.
-Amit
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Two transformers, one for calculation.... one to abort.....
Hummm..... worth trying :wink:

Thanks amith.

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

Post by ray.wurlod »

Best practice is never to abort, to remain always in control.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, not exactly a constructive comment, but I found something amusing in the concept that you make the job more efficient and shorten the runtime by aborting it. :wink:

I guess that's as opposed to letting it continue to run when you know things are going south and will need to be rerun.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,
I too agree with your words that not to be aborted.
But the input file is Veryyy... huge. If it reject more that 2% for a condition, the input file should be reprocessed.
The actual requirement is to stop the flow of the job.
Since i dont know how to stop the flow i am aborting it with some log :roll: .

regards
kumar
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,
I too agree with your words that jobs not to be aborted.
But the input file is Veryyy... huge. If it rejects more that 2% for a condition, the input file should be reprocessed. And if it starts to reject it would reject in early number of records.
The actual requirement is to stop the flow of the job.
Since i dont know how to stop the flow i am aborting it with some log :roll: .

regards
kumar
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
What about stopping the job? ( DSStopJob() )
DS 7.5 introduced the Terminator Activity for sequence jobs that has an option to send such stop requests to running jobs.
This sohould be a safe alternative to aborting jobs.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Re: How to abort a job?

Post by battaliou »

You could always divide by 0 if you want a quick failure.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
Post Reply