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



William,

Even with a timer, there's no guarantee that the record won't be locked
if a user is working with the record while the nightly process is
running, assuming its 24/7 type access to the file.

This sounds like a place to utilize the USROPN keyword and/or reade(n)
opcode. Instead of locking the record when it's read and maintaining
the lock until update, open the file, read the record without a lock,
and chain only when the user is ready to commit the change. It means
renaming the display fields and populating them during the read, but it
will avoid the record locking situation you're describing.

F FILEA UF A E K DISK USROPN

Open FILEA;
Reade(n) FileKey FILEA;
FIELD1D = FIELD1;
...
Close FILEA; (optional)

Exfmt FILEADSP;

If enter_key;
Open FILEA; (if previously closed)
Chain FileKey FILEA;
FIELD1 = FIELD1D;
...
If %found(FILEA);
Update f_FILEA;
Else;
Write f_FILEA;
Endif;
Close FILEA;
Endif;

Another option would be to change your processing program to monitor for
record locks and skip the record. This would be the way to go if you
don't want duplicate historical records. Are you deleting records as
they are written to the history file, or trying to clear the file all at
once?

Tom Armbruster

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Willie J. Moore
Sent: Friday, April 18, 2008 3:29 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Auto ending a program

We have a program that lets users update a fileA. Dunning our nightly
processing we copy the fileA data to a history file and then clear
fileA. If the user has the update program active, the clear will not
run. I want to change the program so that if the enter/update key is not
entered after X minutes the program would end.
I have compiled the display file with WAITRCD = 120 and added to RPGLE
the 'F' spec for the display file MAXDEV(*file). Every thing compiles,
but still does not timeout.
Any help or examples would be appreciated.

William Moore


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.