Abort a job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ppavani_km
Participant
Posts: 11
Joined: Mon Mar 17, 2008 3:14 pm

Abort a job

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

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

Post 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".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

how do you check if the parameter value is valid or invalid?
your design will be based that.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

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

Post 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.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ppavani_km
Participant
Posts: 11
Joined: Mon Mar 17, 2008 3:14 pm

Post 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.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

in transformer you can check if the value system_name <> "ABC" and abort after one rwo in the contraint.
Post Reply