Page 1 of 1

Running and resetting jobs from within job control

Posted: Tue Apr 06, 2004 8:49 am
by SANOJ
I created a job which purpose it is to call an underlying job n times (in a loop). I did this within the job control section of the job properties. This mechanism works fine, except if the underlying job aborts, because then the controlling job stops too.

Now I want to ensure that my controlling job calls the underlying job again (with different parameters)

I tried to use the RUNRESET instead of RUNNORMAL to call the underlying job, but then I got an errormessage stating that the underlying job had never been run.

So the question is : which statements should I include in the jobcontrol so that if the called job aborts, it can be called again (with different parameters) in the next iteration of the loop.

Posted: Tue Apr 06, 2004 9:07 am
by chulett
You might want to post your code so you can get specific help. But, as a general comment, after you attach to the job you can call DSPrepareJob before you run it and that will reset the job if it needs it.

Posted: Tue Apr 06, 2004 9:35 am
by kcbland
I would lay a bet on that the poster has not detached the current job handle and re-attached a new handle. You need a new handle for every run, and must detach the old if you want to RESET the job.

Posted: Wed Apr 07, 2004 2:57 am
by SANOJ
Both suggestions worked. :D
Thanks!

Wim