Is There any way to abort a job after 50 warnings

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

nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Is There any way to abort a job after 50 warnings

Post by nkln@you »

We are in need to abort a dimension job after 50 errors are thrown and abort a fact job if 1 error is thrown.

If we set the tracing properties in director, it will set to the whole project.


How can we apply individually this abort limit to a job.
Aim high
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Go to Tools-->Option-->Limits
Set the values as required for the individual jobs.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

In 7.0 this option is not present

I went to Tools->Options , but could not find limits.
Aim high
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

How you call the job, is it through the sequnce or from command prompt. If the job is been called from command prompt by dsjob command, you can make use of 'dsjob -run -warn # {job name}' property. You can provide the warning limit at the -warn parameter.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

I am running the jobs through sequencer
Aim high
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's fine... whatever Warning Limit is in effect for the 'parent' Sequence job itself will be passed to all 'child' jobs that it runs automatically.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

I need information as well. Can anybody please suggest a way to set number of warnings for individual jobs, rather than for all the jobs when using a sequence?

Thanks.
gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If by that you mean running a series of jobs via a Sequencer and you want individual jobs to have different 'Abort after' warnings levels - you can't. That kind of thing would require custom job control code.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

OK, that would mean if the previous poster 'Aim High' were to set warning limit to 50 for his dimensions and 1 for the Fact, then he would need to have them in separate sequence. Am I right?

gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes. Completely separate sequence jobs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

I am planning to force abort a job after 50 errors . Is this possible by writing a code in a job. i.e by capturing number of rejected rows and then force abort a job. How can i do this in a simple way. I need to incorporate this in so many jobs.
Aim high
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Post by vcannadevula »

nkln@you wrote:I am planning to force abort a job after 50 errors . Is this possible by writing a code in a job. i.e by capturing number of rejected rows and then force abort a job. How can i do this in a simple way. I need to incorporate this in so many jobs.

Based on the number of reject rows you can abort by UtilityAborttoLog() routine.

If it is based on number of warning, when you start the sequecne set your warning limit to 50, datastage it self will abort the job after this.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I dont think you can do that at the job level. Forcing a job to abort inside the job, never heard of it, and cant think of any way to do it.
As others have suggested, you can
a) Do it via sequencers or
b) By custom job routine.

Gurus, Can this be done by building a Batch job outof these jobs and in the job control,
add a code

Code: Select all

ErrCode = DSSetJobLimit(hJob3, DSJ.LIMITWARN, n)
where n = limit set.
??? :roll:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

and hJob3 = My Job.
:oops: Forgot to add that in my previous post.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

DSguru2B wrote:I dont think you can do that at the job level. Forcing a job to abort inside the job, never heard of it, and cant think of any way to do it.
It's a propery of every constraint. You can change the 'Abort after' value from zero rows (which means never) to a specific number - and when that many rows have gone down that link, the job will abort.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply