Part of the mechanism opens up the instances to find out which of them is the caller's parent - this needs to be done with multi-instance jobs due to some internal DS restrictions. I get a string of all 150+ instances and loop through each one of them:
Code: Select all
FOR Index = 1 to NumberOfInstances
JobHandle = DSAttachJob(JobList<Index>,DSJ.ERRFATAL)
{processing}
Dummy = DSDetachJob(JobHandle)
NEXT Indexand then I continue processing. Later on I have another DSAttachJob() which I use to fill the parameters and do a DSRunJob(), then issue a DSDetachJob() which is then causing a FATAL error:
JdDSSJOBCheckJobControl..AfterJob (fatal error from DSDetachJob): Job
control fatal error (-1)
(DSDetachJob) Invalid job handle 4
This is quite sporadic. I am also being told that occasionally this DSRunJob() is executing a different file handle than it should. So something is definately getting mixed up with the job handles. I am awaiting information from support, but they are not being forthcoming [I traced the message using VLIST but need them to decode a COMMON variable name for me]. The documentation states that DSDetachJob() should only return an error when trying to close DSJ.ME, but in this case it is aborting the jobs!
Has anyone seen anything like this before or have any suggestions?
</a>