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



Hello Darryl,

thanks for your valuable input!


Am 15.04.2020 um 02:53 schrieb DFreinkel <dfreinkel@xxxxxxxxxxxxxxxxx>:

This is confusing
How are you using a ODBC driver in RPG?

I don't. Sorry for being ambiguous. The ODBC-Access to the file(s) is happening from outside the AS/400, from Linux via ODBC.

Are you allocating the files *excl?

How can I tell if I do?

Another way to read a file twice in a rpg program is to use file-a and file-b in the rpg. Rename the record format on the f-spec of one of the files.

Before compiling do a ovrdbf file-b to file-a. Create the pgm interactively to keep the ovrdbf in effect basically the same job.

It should compile.

You can create a cl to compile in batch
- ovrdbf File-b file-a
- crtrpgpgm

Next before running the job
You will need a cl program to
- ovrdbf file-b to file-a
- call your program
-dltovr

Does this do it for you?

Sounds complicated. :-) Honestly, I don't see how this could help. Basically I want to "switch" from read-write to read-only within the RPG program and vice versa, so the table(s) are opened read-write within the Green Screen application for as short as possible, to avoid the locking problem with external ODBC access.

At the moment, I'm using LFs with different file- and record format names pointing to the corresponding PFs. The LFs are opened all the time, while I open the PFs just before DELETE/UPDATE from the Green Screen Application. This is a working solution since the reading routines in RPG are different from the writing ones.

While this basically works, I don't know why this locking issue happens in the first place, and what other, maybe more elegant ways exist to overcome the described issue.

Does this clarify things?

:wq! PoC

PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc



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.