× 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.



Luis:

When I want only one instance of a program to be allowed to run at a time, 
I use

     ALCOBJ   OBJ((MYLIB/MYPROGRAM  *PGM  *EXCLRD))

at the start of execution of the program itself.  If the allocate fails, I 
have the program terminate (with an appropriate message, of course).

If you wanted just to know whether one OR MORE instances were running, 
make the lock state nonexclusive and check elsewhere for object locks on 
the program object.

You could, of course, lock something else using the same technique instead 
of the program itself, but this does kinda "sound right".

In either case, do remember to deallocate the object when the program 
terminates.

---------------  Luis Rodriguez wrote  ---------------

message: 4
date: Wed, 26 Oct 2005 08:53:02 -0400
from: "Luis Rodriguez" <luisrodriguez@xxxxxxxxxxx>
subject: Allocating a *PGM object

Hi all,

Does anybody know how to check if a program is being used for another
job? I had thought of using ALCOBJ, but it only protects the program of
being deleted.

Thanks for your help,

Luis Rodriguez

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.