how to abort the job based on the input

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
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

how to abort the job based on the input

Post by vij »

Hi,

I want to know is there anyway i can abort a job based on the input value... for eg .. if coulmn1<>a, i want the process to be aborted.

is there any function which i can use in transformer stage?
also i want a message to be displayed, the description for the abortion process - like "column1 is not a" ..

pls help me.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

You can set this as a Constraint in a Transformer and then set the "Abort After Rows" to 1 - this will abort the job when the constraint is violated.

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

Post by kumar_s »

You can use the Utility UtilityAbortToLog with the necessary error messages passed based on the condition in transformer.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

For the message in the log - you can use the UtilityMessage
ToLog from the sequence. There are many other options to do this. Search and you will get it.
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Post by vij »

can u pls explain me this in detail ... becos i used this option, and as soon as 1 record is loaded, in the link the job is aborted .. fatal error is "Job aborting due to row limit being reached on output link".

actually even when the condition is true, the job gets aborted


thebird wrote:You can set this as a Constraint in a Transformer and then set the "Abort After Rows" to 1 - this will abort the job when the constraint is violated.

Aneesh
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Post by vij »

i have given two links from transformer.

constraint for link1- inputcolumn=1,no abort
constraint for link2- inputcolumn<>1,abort after 1 row

but as soon as i trigger the job, one record for each link is loaded and the job abortes with fatal error - Job aborting due to row limit being reached on output link.

can anyone help me figuring out the error?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

The job is aborted as it is asked for. Abort After n Rows will not give you the message that you want to, but will abort with the mentioned message. If you have value inputcolumn<>1 the job will abort.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
aakashahuja
Premium Member
Premium Member
Posts: 210
Joined: Wed Feb 16, 2005 7:17 am

Post by aakashahuja »

Use the DSStopJob Function

This routine should only be used after a DSRunJob has been issued. It immediately sends a Stop request to the run-time engine. The call is asynchronous - if you need to know that the job has actually stopped, you must call DSWaitForJob or use the Sleep statement and poll for the DSJobStatus macro. Note that the stop request gets sent regardless of the job's current status.

Syntax
ErrCode = DSStopJob(JobHandle)

JobHandle is the handle for the job as derived from DSAttachJob.

ErrCode is 0 if DSStopJob is successful, otherwise may be the following:

DSJE.BADHANDLE Invalid JobHandle.

Example
The following command requests that the qsales job is stopped:

stoperr = DSStopJob(qsales_handle)
aakashahuja
Premium Member
Premium Member
Posts: 210
Joined: Wed Feb 16, 2005 7:17 am

Post by aakashahuja »

Use the DSStopJob Function

This routine should only be used after a DSRunJob has been issued. It immediately sends a Stop request to the run-time engine. The call is asynchronous - if you need to know that the job has actually stopped, you must call DSWaitForJob or use the Sleep statement and poll for the DSJobStatus macro. Note that the stop request gets sent regardless of the job's current status.

Syntax
ErrCode = DSStopJob(JobHandle)

JobHandle is the handle for the job as derived from DSAttachJob.

ErrCode is 0 if DSStopJob is successful, otherwise may be the following:

DSJE.BADHANDLE Invalid JobHandle.

Example
The following command requests that the qsales job is stopped:

stoperr = DSStopJob(qsales_handle)
Post Reply