Page 1 of 1

Abort a job

Posted: Fri Jul 18, 2008 7:40 am
by ppavani_km
Hi,

My requirement is if the input parameter value which i give to the job is invalid then I need to abort the job.
Can any body tell me how to abort the job.
I don't want to use Sequencer for this?

Thanks,
Pramod.

Posted: Fri Jul 18, 2008 8:06 am
by ArndW
Create a transform output link that only gets a record when you want the job to abort and limit that link to 0 records.

Posted: Fri Jul 18, 2008 3:15 pm
by ray.wurlod
What do you mean by "invalid"? A parameter value that is invalid based on data type - for example "FRED" as a date - will not even allow the job to start. Otherwise, use Arnd's offered solution, but limit the link to 1 record because 0 means "unlimited".

Posted: Fri Jul 18, 2008 10:12 pm
by keshav0307
how do you check if the parameter value is valid or invalid?
your design will be based that.

Posted: Sat Jul 19, 2008 12:57 am
by ArndW
Aha, thanks Ray - I thought I had edited out the "0" and put in "1" after I posted the message.

As Ray correctly pointed out, the value of "0", which is the default, means unlimited rows and wouldn't have the desired results. I just re-read your post and you mentioned the input parameter, not a data value. In that case, it would be best to catch this in the sequence calling the job and never enter it. If you still need to do this, then use the "Job Control" code to test the value of the parameter and, if it is invalid, issue a direct call to DSLogFatal() so that the job never really gets going.

Posted: Sat Jul 19, 2008 3:51 am
by ray.wurlod
It just occurred to me that, since you apparently don't want to use a job sequence (not a Sequencer - that's something you have IN a job sequence) that you could also effect whatever tests you like in a before-job subroutine. Setting the ErrorCode argument to any non-zero value will cause the job to abort when the subroutine returns.

(I would have thought of this earlier, except that I have a predilection againt having jobs abort under any circumstances.)

Posted: Mon Jul 21, 2008 11:41 am
by ppavani_km
My input file will have coloumn name system_name.
For example if system_name = "ABC" then i need to continue the job ahead else i need to abort the job.

For my job the system name will be given as input parameter. i.t if paramater value entered as "ABC" tha value should be there in the System_name coloumn.

so thats my requirement.

Posted: Mon Jul 21, 2008 7:58 pm
by keshav0307
in transformer you can check if the value system_name <> "ABC" and abort after one rwo in the contraint.