Stopping a multiple instance job

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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Stopping a multiple instance job

Post 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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

Post 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Stephan

That is not encouraging but thanks.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

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

Post 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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
Post Reply