Page 1 of 1

Best way to abort a job

Posted: Wed May 28, 2008 10:53 pm
by jtsoong
Hi guys

I have a filter that has a Reject link.

If something comes down the Reject link i'd like to write the row to a file and then Abort the job.

The best way I can think of to do this is have:

Filter Stage -- reject link --> Sequential File Stage --> Transformer --> Data Set

In the Transformer I am doing an "Abort after 1 row" in the Constraint. I have to have the Data Set Stage so the Transformer has an output.

Is there a better way to do this? :)

Cheers

Jon

Posted: Thu May 29, 2008 12:40 am
by ray.wurlod
The output from the Transformer stage can go anywhere. If you don't want to keep that row, use a Copy stage with no output. If you simply want it in the job log, use a Peek stage. If you really want the row in a file, use a Sequential File stage. A Data Set is overkill for one row.

Posted: Sat May 31, 2008 4:06 pm
by ray.wurlod
The original question was marked "parallel job" and I answered thus.

In both parallel and server jobs forcing an abort will roll back any uncommitted transactions.

Committed transactions have, well, been committed.

Posted: Sun Jun 01, 2008 3:20 am
by ag_ram
ray.wurlod wrote:The original question was marked "parallel job" and I answered thus.
This discomfort comes, only when it is a Parallel Job, on which i came to give enough focus with experimental result. If it is fortunately a Server Job, File Stage can be used to get records after the Transformer Stage which has "Abort after Rows" constraint.
ray.wurlod wrote:In both parallel and server jobs forcing an abort will roll back any uncommitted transactions.
I have no undersatnding of your word here - uncommited transaction and so i need a clarification of what the commit means to act in DataStage rather being mean to write/load records into file/table, because i saw the files, which are defined after our considered Transformer Stage or anywhere, created in the target place but will soon be dispappeared(file writes rolled back) at the end of that aborted Job.

Posted: Sun Jun 01, 2008 2:08 pm
by ray.wurlod
My usage of "commit" is the standard, (almost) universally understood one.

Posted: Mon Jun 02, 2008 1:06 am
by ray.wurlod
You are the only one who thinks it is strange.

If I have to leave my desk to deal with some other emergency, and my session to the database times out (or even if I just switch off my client), any uncommitted transaction will (eventually, in some cases) be rolled back.

Posted: Mon Jun 02, 2008 2:31 am
by ag_ram
ray.wurlod wrote:...If you really want the row in a file, use a Sequential File stage.
I dont find any row in the sequential file and the truth is file is not created in the target place and the reason i given already.

Still i have been holding this question "Why File is not created" without answer?

Please share your views.

Posted: Mon Jun 02, 2008 5:52 am
by ray.wurlod
I think you've now hijacked the thread - your current rumination has nothing to do with the topic of the thread "best way to abort a job".

Posted: Mon Jun 02, 2008 6:00 am
by ag_ram
No.

I feel that the solution suggested by the first man, is NOT working and i am asking him for clarification.

Posted: Mon Jun 02, 2008 6:05 am
by ameyvaidya
Dunno if this adds any value to the discussion but there is an option in the sequential file stage that's titled:

"Clean up on Failure" which is defaulted to true.

Setting it to false may give you some data in the file.

Posted: Mon Jun 02, 2008 6:12 am
by chulett
'The first man'? Dude, it's just you and Ray (as usual) going back and forth. And at this point it's just annoying when you drag threads off on tangents like this.

Why don't we setup an Ram Ruminations topic over in the General forum? That way, when you want to do things like this, you can simply link back to the thread in question as a pointer, perhaps even throw a quote or two in and you can lay it all out there. Whomever wants to jump in can jump in to duke it out, but we keep all of this detritus out of innocent bystander's threads.

Posted: Mon Jun 02, 2008 6:13 am
by chulett
ameyvaidya wrote:Dunno if this adds any value to the discussion but there is an option in the sequential file stage that's titled:

"Clean up on Failure" which is defaulted to true.

Setting it to false may give you some data in the file.
Actually, it does. Thank you for posting that. I assume 'clean up' in this case means remove / delete when the job fails.

Posted: Mon Jun 02, 2008 4:08 pm
by ray.wurlod
This thread, may I remind you again, is "best way to abort a job".

Posted: Mon Jun 02, 2008 11:55 pm
by ag_ram
Your first response was
The output from the Transformer stage can go anywhere. If you don't want to keep that row, use a Copy stage with no output. If you simply want it in the job log, use a Peek stage. If you really want the row in a file, use a Sequential File stage. A Data Set is overkill for one row.
I dont deny anything here. I am always with you agreeing all the truth you declare.

But I ask you for a clear clarification and nothing else.