DOS command to 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
Rajee
Participant
Posts: 46
Joined: Thu Mar 13, 2008 7:06 am
Location: India

DOS command to abort a job

Post by Rajee »

Hi,

If the storedprocedure extracting data from the source tables returns no record, then I need to abort the job.
I guess it can be done in the after job routine by calling some batch file.If so,can anyone let me know the DOS command through which i can abort the job.

Thx,
Rajee
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

I dont understand how are you going to abort the job from the after job routine. One way you can achive it using the sequence job. In the sequence job first check that data is present in table. If it returns data then trigger the job using job activity stage otherwise stop the job.
Birendra
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Setting the second argument (ErrorCode) of an after-job routine will abort the job. If you are using ExecSH or ExecDOS it should be sufficient to execute a command that will fail, for example mr mxyzpltk
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajee
Participant
Posts: 46
Joined: Thu Mar 13, 2008 7:06 am
Location: India

Post by Rajee »

ray.wurlod wrote:Setting the second argument (ErrorCode) of an after-job routine will abort the job. If you are using ExecSH or ExecDOS it should be sufficient to execute a command that will fail, for example mr ...


Ray I am not able to have a complete view of your reply,hence still no clue about implementing the above functionality.......
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Premium membership is inexpensive, at less than 30c (Rs12) per day. if you had premium membership you would be able to read my entire reply, and get other benefits as well.

All revenue from premium membership is devoted to defraying hosting and bandwidth costs incurred by DSXchange. So, by taking premium membership, you additionally benefit by ensuring that DSXchange will be there to answer your questions in future.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajee
Participant
Posts: 46
Joined: Thu Mar 13, 2008 7:06 am
Location: India

Post by Rajee »

Rajee wrote:
ray.wurlod wrote:Setting the second argument (ErrorCode) of an after-job routine will abort the job. If you are using ExecSH or ExecDOS it should be sufficient to execute a command that will fail, for example mr ...


Ray I am not able to have a complete view of your reply,hence still no clue about implementing the above functionality.......


Ray,I cannot use any after-job routine to abort the job as I am using ExecDOS in the after-job subroutine to call a batch file.Also,i need to check for if a particular file is empty and only then abort the job.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course you can. You can execute a pipeline through ExecDOS (for example command1 ; command2) or you can create your own after-job subroutine that invokes the batch file and tests for the empty file.

I still prefer never to abort jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajee
Participant
Posts: 46
Joined: Thu Mar 13, 2008 7:06 am
Location: India

Post by Rajee »

ray.wurlod wrote:Of course you can. You can execute a pipeline through ExecDOS (for example command1 ; command2) or you can create your own after-job subroutine that invokes the batch file and tests for ...

Ray,as Iam not able to view your response fully I am not able to understand your logic/solution fully and implement it.If getting the premium membership is the ony way to view your response fully then I am unfortunate as of now.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Rajee - the important part of Ray's post is visible to you.
Rajee
Participant
Posts: 46
Joined: Thu Mar 13, 2008 7:06 am
Location: India

Post by Rajee »

ArndW wrote:Rajee - the important part of Ray's post is visible to you. ...
ArndW,as per Rays logic,
1.I need to invoke the batch file through the after-job subroutine and check for the file with 0 byte and abort the job.

My queries with respect to Ray's response are,
1.How to invoke a batch file through after-job subroutine?
2.How to pass the batch file parameters if I invoke the batch file through after-job subroutine?
3.I know only a DOS command to check for the existance of 0 byte file,in such case can i call the Datastage subroutine through the DOS command that i use to check for the 0 byte file in the batch file to abort the job.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search in on-line help for DSExecute subroutine.
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