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



This is confusing
How are you using a ODBC driver in RPG?
Are you allocating the files *excl? This would lock out the odbc program whatever program is using the odbc.

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?

Darryl

Sent from my iPhone

On Apr 14, 2020, at 7:26 PM, Paul Therrien <paultherrien@xxxxxxxxxxxxxxxxxx> wrote:

You can rename the files' record formats in the program.
You cannot have the same file twice but you can have and LF and PF.
You just need to use the RENAME keyword for the record formats.

Paul


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Patrik
Schindler
Sent: Tuesday, April 14, 2020 2:24 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Legacy File handling: Switching between files opened read-only and
read-write

Hello,

when I try to access a table from ODBC in read-write (delete from, update)
and the very same table is opened in a green screen program for update (UF
in file spec), the ODBC-Session will not get access to the table at all.

I was wondering about a good way to work around this problem. Use LFs for
all readonly work within the green screen program, and open the PFs on
demand? Provide two F-specs per PF, one as IF and one as UF? => Does not
work, Compiler complains about that the filename was already referenced.

Other ideas?

I try this with V4R5.

:wq! PoC

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


--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.