× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Hi,

2 batches batch1 & batch2 constantly lock due to users running a program BUP009C.

I would guess that the problem is due to someone accessing a particular file or set of files in the BUP009C program. If a different program, or query, or FTP session, or anything else happened to access these same files it would cause the same problems.


The way that I'd fix it is to have the batch programs use the ALCOBJ command to get exclusive use of the files. When it's done with those fields, use the DLCOBJ command to release them.

That way, while the file is allocated, no other jobs (including BUP009C, but also including any other programs, queries, file transfers, etc) will be able to access the file. When they try, they'll just get an error message.

You could even code BUP009C to check to see if it can get to the file, if it can't, it could send a friendly message to the user saying "Sorry, the batch jobs are running. Try again later" (or something to that effect.)



Inorder to let 2 batches run through, I usually find User-id who is running the job BUP009C and cancel his job.



If you use ALCOBJ, the only time you should have to cancel jobs would be when the ALCOBJ command fails. In that case, you might be able to use an API to get a list of jobs that are holding locks on the file objects, and cancel those jobs.



I want to place a program which would constantly check during time period 5pm-7pm which user is running BUP009C at that time(batch1 starts at 5pm , batch2 starts at 5.15pm,both end around 7pm) and send message to all users on AS400 lettinng them which user is running and asking him to cancel out his session. any ideas appreciated..


Please don't do it "constantly" because that won't solve the problem. Instead, get exclusive use to the files ONCE, allocate them, and then you can run your batch programs uninterrupted. Once the batch jobs are done with them, deallocate them so that the interactive jobs can access the files again.


HTH


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.