Page 1 of 1

Select DS_JOBS not finding multiple instances

Posted: Wed Apr 13, 2005 7:49 pm
by mointampa
Hi All
I have written a job to reset all the jobs/sequences within the current project.

To get the list of all the server jobs and not select the mainframe jobs I am using:
SSELECT DS_JOBS WITH NAME LIKE 1A0X AND JOBTYPE <> 1

which seems to work well, except that it will ignore multiple instances of the same job.

For example JOB001 will reset but JOB001.DEV, JOB001.TST will stay in their aborted state.

Does anyone know of a way to modify the above query to retrieve all server jobs including all the instances of multiple instance jobs?
Thanks in advance.

Posted: Wed Apr 13, 2005 8:21 pm
by kcbland
Just mass-compile the base jobs, all the instances will disappear. Upon next call for execution, the invocation id will not be found and the instance will be automatically created.

Re: Select DS_JOBS not finding multiple instances

Posted: Wed Apr 13, 2005 10:16 pm
by mointampa
mass compile is not really an option as this has to run at the start of the day automatically on a testing server that does not have the client installed. Is there another way to clear the multiple instances using a server job?
Thanks

Posted: Thu Apr 14, 2005 2:32 am
by ray.wurlod
Jobs are stored in DS_JOBS. It's the table that maps job names to job numbers. It does not record instances. Being capable of running in multiple instances is a property of the job; the individual instances are not separate jobs. Instances are run-time, not design-time, properties, and so are stored in the run-time tables (primarily RT_STATUSnnn and RT_LOGnnn).

Posted: Thu Apr 14, 2005 8:17 am
by kduke
You will not be able to select these in the same select statement. You can call a routine to get the instance ids. There are several posts on this. You might want to search for them. There are also posts on dictionary items and routines on which job is a multiple instance job. Ray posted a routine long time ago.