how to abort the job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mohanraj
Participant
Posts: 48
Joined: Sat Mar 25, 2006 12:40 am
Location: bangalore

how to abort the job

Post by mohanraj »

Hi

Can anyone tell me that how can I abort the job.For one of my research work I am taking data in sequential file and it contains 100 records and my target is DRS.I want to make after 50 records my job should get abort.Please send me some problems by which I can abort my job.
It may looks silly for you guys but,please send it fast asap.

thanks
mohan
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Explicit call to DSLogFatal would abort the job. You can use it within the stage variable.
Success consists of getting up just one more time than you fall.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

There are several ways of doing it. Use Abort after n rows option available in Transformer. Or by counting the number of rows passing on a column, you can use AbortUlitility. Or Teminator stage in JobSequence(If you have in your version). You can search for this.
But Why do you need to abort the job. Rather you have change you design to send some notification and stop the further process.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

loveojha2 wrote:Explicit call to DSLogFatal would abort the job. You can use it within the stage variable.
Can you clarify this.

I tried using DSLogFatal in my transformer stage before but it did not work. I know we can use this subroutine in Afterjob subroutine or transform function but not sure we can use it in stage variables.
dprasanth
Charter Member
Charter Member
Posts: 90
Joined: Fri Oct 07, 2005 7:55 am

Post by dprasanth »

balajisr wrote:
loveojha2 wrote:Explicit call to DSLogFatal would abort the job. You can use it within the stage variable.
Can you clarify this.

I tried using DSLogFatal in my transformer stage before but it did not work. I know we can use this subroutine in Afterjob subroutine or transform function but not sure we can use it in stage variables.
When you mean abort .. you mean stopping the job right.. so what you can do is when you click the run button , there is a tab called LIMITS, there is an option called STOP STAGES AFTER and you can specify after how many rows you want to stop the job.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

balajisr wrote:I tried using DSLogFatal in my transformer stage before but it did not work. I know we can use this subroutine in Afterjob subroutine or transform function but not sure we can use it in stage variables.
Works just fine. All you need to do is call it and your job is dead, so not sure under what circumstances it wouldn't work. :?

And it would be simple enough to do that conditionally when @INROWNUM hits 50, if someone really wanted to do that.
-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 »

Best practice is to design server jobs so that they never abort, so that you retain control at all times, in my opinion.

Etiquette Note
Terms like "fast" and "asap" create negative feelings here. This is an all volunteer site; folks post as and when they can. If you want "fast" or "asap" sign up for premium service from your support provider and learn the true cost of "urgent".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

chulett wrote: Works just fine. All you need to do is call it and your job is dead, so not sure under what circumstances it wouldn't work. :?

And it would be simple enough to do that conditionally when @INROWNUM hits 50, if someone really wanted to do that.
When i tried to call DSLogFatal in the derivation of the transformer stage i got an error like 'Array DSLogFatal not dimensioned' which is same as one would get if the header files are missing when you call it from a routine.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The DSLogFatal is not called as a function but as a routine, which is why you are getting the error. I would recommend putting a transform output link into your job that is set to fail the job if any rows go down that link; this is simple to do and easy for people looking at the job to understand.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

balajisr wrote:When i tried to call DSLogFatal in the derivation of the transformer stage i got an error like 'Array DSLogFatal not dimensioned' which is same as one would get if the header files are missing when you call it from a routine.
You're right... I didn't mean you could use it directly in the derivation, but would need to wrapper it in a routine and include the appropriate headers. Should have explicitly mentioned that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

chulett wrote:You're right... I didn't mean you could use it directly in the derivation, but would need to wrapper it in a routine and include the appropriate headers. Should have explicitly mentioned that.
Thanks Craig for the clarification.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: how to abort the job

Post by ray.wurlod »

mohanraj wrote:Can anyone tell me that how can I abort the job.
The ol' power switch is singularly effective! :lol:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply