|
> 1. Locks a data area (so no one elses can run this job). > 2. Performs some data validation. > 3. Submits another job to QBATCH to perform some processing. > 4. Releases the data area lock. > >However, the lock on the data area needs to be maintained until the batch >job has finished. Even though the submitted job re-locks the data area, >this action could be delayed if it gets queued up behind other jobs, and >someone else could obtain the lock on the data area. > >Can anyone help or perhaps suggest a better method ? There's no way I know of to maintain a lock if your first job goes away and the submitted job is in a job queue waiting to run. Instead of using a lock to prevent another copy of the first program from running try this. When the first program starts change the data itself in the data area (or another data area) to indicate the job is running, then have the submitted job change the data back when it goes to end of job. In the first program, read the data area and check the data to see if either program is already running. If the data indicates one is, then go to end of job, else, begin running and change the data to indicate a running status. Of course, if one of the programs bomb, the data area would need to be changed manually to indicate a non-running status before the next job could be started. Terry Herrin Sr. Programmer/Analyst New Hanover Regional Medical Center +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.