It all depends on exactly what your requirements are. Do the jobs have to run at the same time or can they be run after each other? Does one job have to finish before the other can start or is just a process in the middle of the job that you are worried about. Are the jobs part of a third party package that you don’t have the source for?
The way I would probably tackle this, assuming you have the source for the programs, would be to either allocate an exclusive lock on an object or use a data area for “locking” the jobs as and when required.
If I used the allocate object method, I would allocate an exclusive lock at the point that I wanted to check for a conflict and if I failed to lock the object then I would delay the job for a short period of time – say 30-60 seconds (or longer depending on the process) before trying again and repeat this process until the object is free.
Immediately after the process completes I would release the lock so the other process could use it. This logic would need to be put in each job that you wanted to synchronise. If locking an object would cause problems in other routines then I would create a 1 character data area or table just for use by the two jobs as a “flag” object and lock that.
Using data areas I would create a data area that I would simply retrieve the contents of at the syncronising point and depeending on the contents would either delay the job or continue. Similarly to the allocate lock method I would write a value to the data area that indicated “lock” and another value that indicated “free” as appropriate.
For the data area method I would probably use something like the qualified job name as the locking value and blanks as the “free” value so that support personnel could see by interrogating the data area which job had the “lock” at the time.
Hope it helps
Since you’re running a multi-user, multi-tasking system that can accommodate multiple concurrent locks on data objects, can you describe your problem a little more? Why do you think it’s necessary to “avoid conflicts” in using files and dataareas? What conflicts are trouble for you?
Without a description of the conflicts, there is no way to know good ways to “avoid” them nor if it even should be done.