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



I see you have already gotten a number of good ideas.  I have a few more to
add.

Most of the ideas have suggested using a cl command to allocate some other
object.  Keep in mind that programs are allocateable objects, too.  The
object you try to allocate exclusively can be the very program you want to
limit to one instance.  Kind of keeps it neat and tidy.

Another trick we have used for programs with a display file is to work with
object lock.  The calling cl will look to see if there is an object lock on
the display file.  Doesn't have to be exclusive lock, it just has to come up
when you run the command.  Of course, this method requires a lot more coding
to complete since you have to dump the results of the command into a file
and read that file seeking the name of the display file in question.

Hth.

Rick Weber | TЯU International 


-----Original Message-----
From: Venkateshwar [mailto:venkateshwar.raman@xxxxxxxxx] 
Sent: Wednesday, November 09, 2005 6:37 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Only one instance of program.



Hi,

 

Is there anyway by which I can ensure that only one instance of a program is
running? This program generates a number and there is chance that it can be
called by 2 programs to generate number and there is a chance both can get
same number.

 

Regards,

Venky.





Confidentiality Notice 

The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify the sender at Wipro or Mailadmin@xxxxxxxxx
immediately and destroy all copies of this message and any attachments.

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.