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



Pete,
let me suggest you take a look at the RTNDTA keyword for display files.
Have not the books onhand, but Googling for RTNDTA you get some examples, one of which tells:

You can use RTNDTA as follows:
................

Use RTNDTA to allow an RPG III program to perform file maintenance
with less locking of records in the database. For instance, the
program reads a database record and displays the record at the
display device. The workstation user reviews the record, makes any
required changes, and presses the Enter key. While the workstation
user is making changes, the database record, if locked, is
unavailable to other programs. Hence it is recommended to leave
the database record unlocked. However, when the program reads the
record from the display and updates the database record, the
database record overlays the internal representation of the
display record in the program. Instead of preventing the overlay
by using different field names for the display record and the
database record, the program rereads the display file. With RTNDTA
specified, the program retrieves the display record again and can
then finish updating the database.

In this way, if your display record includes RTNDTA, even if your disk file and display file records use same field names, your program could do:

- read disk file data WITHOUT LOCK
- EXFMT showing disk data just read
.....
after the user hits Enter key (or whatever)
- read disk file data again, this time WITH LOCK
----------> fields just read from the display get their data
overlayed by the data from disk!!!
- READ (I say READ, NOT EXFMT !!!) again to your display file
----------> RTNDTA keyword will bring you back the data from the
display record (previously read by the EXFMT...), back to the fields
- the do the UPDATE to disk or whatever...

HTH,
Antonio
----------------------------------------------------------------------

Pete Helgren escribió:

So, without making too many changes and breaking something, I figure I should be able to:

1. READ the record (with no lock)
2. Present the data to the screen
3. Edit the data as usual
4. READ the record again with lock for update
5. Update the record releasing the lock.



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.