Best way to abort a job

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jtsoong
Participant
Posts: 29
Joined: Mon Oct 22, 2007 11:52 pm

Best way to abort a job

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

My usage of "commit" is the standard, (almost) universally understood one.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

No.

I feel that the solution suggested by the first man, is NOT working and i am asking him for clarification.
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post 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.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This thread, may I remind you again, is "best way to abort a job".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post 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.
Post Reply