Page 1 of 1

Stopping a multiple instance job

Posted: Fri Oct 10, 2003 9:36 am
by kduke
DataStagers,

Does anyone know how to stop a multiple instance job? This code does not work:

JobName = 'QaJobHistMI.Mi1'
RunHandle = DSAttachJob(JobName, DSJ.ERRNONE)
JStat = DSGetJobInfo(RunHandle, DSJ.JOBSTATUS)
if JStat = 0 then
JobStatus = 'Running'
JStat = DSStopJob(RunHandle)
end
JStat = DSDetachJob(RunHandle)

Has anyone been able to stop a multiple instance job in a program? I know the Director can do it. Does the dsjob command work?

Kim.


Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com

Posted: Fri Oct 10, 2003 10:21 am
by kcbland
When you say it doesn't work, do you mean the job doesn't stop? What kind of job are you testing? If it's a BATCH job not using DS API's chances are it won't stop. There are commands that do not honor a stop, such as SLEEP, EXECUTE, etc.

If your job is a Server job it should work as you've coded it. Unless of course, it's stuck waiting on database activity such as a select or a commit.

Kenneth Bland

Posted: Fri Oct 10, 2003 11:51 am
by kduke
Kenneth

I use this code to stop all my jobs. It works fine with all the jobs tested except a multiple instance server job. The Director can stop the same job. I am not sure what the problem is. That is just the important parts of the code and not all of the BASIC program.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com

Posted: Fri Oct 10, 2003 12:00 pm
by spracht
Hi Kim,

I had a similar problem in DS version 5.2. Trying to stop an invocation of a job, say 'job1.inv1', I got an error message saying that job 'job1' wasn't running or paused, DSStopJob tried to stop the job without invocation. Ascential delivered a patch file which solved the problem.

Kind Regards
Stephan

Posted: Fri Oct 10, 2003 12:29 pm
by kduke
Stephan

That is not encouraging but thanks.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com

Posted: Fri Oct 10, 2003 12:41 pm
by kduke
Stephan

dsjob -stop KimStage QaJobHistMI.Mi1

does not work either. nor:

dsjob -stop KimStage QaJobHistMI

DataStage sux.

Not really.

Kim.


Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com

Posted: Fri Oct 10, 2003 7:41 pm
by spracht
Kim

yes, I also experienced problems with the dsjob command regarding the invocations. dsjob wasn't able to return the correct list of the invocations of a job, usually you get only the job itself. Specifying an invocation as an argument to dsjob, the list will only contain that one invocation.

Kind Regards

Stephan

Posted: Sat Oct 11, 2003 1:44 am
by ray.wurlod
Never tried stopping a single instance! Hmm. Food for thought (and work for Ascential engineering methinks).

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518

Posted: Sat Oct 11, 2003 8:38 am
by kduke
Ray

This code stops all jobs but multiple instances. The bug is not in my code.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com