Page 1 of 1

Batch job hangs

Posted: Wed Nov 12, 2003 1:42 pm
by ewartpm
I have a Control job which executes several other jobs. When the jobs are run individually, they execute without any problems. However, when the control job executes those same jobs, some of them go into a 'running' state and don't process anything. The problem is that the control job has a 'wait for job to end' before executing the next job. This means I now sit with 2 jobs in a 'running' state.

Does anyone have any idea why this happens? What am I missing?

Thanks.

Posted: Wed Nov 12, 2003 3:55 pm
by ray.wurlod
Not without inspecting the actual jobs.
Try - just as an experiment - a control job that doesn't use DSWaitForJob but, instead, a "busy wait" periodically inspecting the status of each running job (until job status <> DSJS.RUNNING) and sleeping for a short interval. It might also occasionally interrogate a link row count.

Posted: Wed Nov 12, 2003 4:21 pm
by kduke
Mark

The wait for job should all be moved to after the the last job you want to run at the same time.

run job1
run job2
run job3
wait job1
wait job2
wait job3
run job4
wait job4

This will run jobs 1,2 and 3 at the same time then wait for all 3 to finish before running job4. Batch jobs were designed as templates. You need to move the generated code around to get it to do it in the order you want.

Kim.