|
Louis, If you use the ALCOBJ in your CL that calls the pgm to get a *EXCL lock, then if the ALCOBJ fails, the program is already running. You must remember to use the DLCOBJ command when you are done. You are responsible for testing the lock state (ALCOBJ) of the *PGM object. As the manual states, the system will *not* automaticaly enforce it if you just try to CALL the pgm. This is what I use to insure that only 1 copy of a program is active at a given time. Luis Rodriguez <luisrodriguez@xxxxxxxxxxx> wrote: Jeff, Thanks for your message. As per the manual (Infamous Center...): ..."When ALCOBJ is executed to get an EXCL lock on a program (*PGM), only the program object description is locked. The program code is not locked exclusively. Therefore, the program may still be run by another user. Changes are not allowed for the program object description while the actual program can still be used." I have received (off-site) the idea of creating a *DTAARA in the process that I'm trying to protect and trying to lock it. That should work (I hope :-) ) Thanks again for your help, Luis Rodriguez > ------------------------------ > > message: 6 > date: Wed, 26 Oct 2005 06:21:37 -0700 (PDT) > from: Jeff Young > subject: Re: Allocating a *PGM object > > You can use the ALCOBJ command in the CL that runs the pgm. > In the pgm that wants to test if Pgm A is running, use the ALCOBJ > command. If Pgm A is running and allocated to CL Pgm A, the ALCOBJ will > fail. > You can monitor for the failure and take appropiate action. > > > Luis Rodriguez wrote: > 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 ---------------- Luis Rodriguez
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.