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



Shell out "ovrdbf...lvlchk(*no)", open the file, check the library as usual.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of James H. H. Lampert
Sent: Wednesday, January 20, 2010 11:28 AM
To: RPG programming on the IBM i / System i
Subject: File open fails because of a level check error -- can I catch this, and find out where it tried to open the file?

We have a situation in which an RPG program is checking the library on
an open file, to make sure it's open in the right library. If it isn't,
it closes out the "wrong" instance of the file, shells out commands to
remove the "wrong" library from the *LIBL and add the "right" one, then
reopens the file in the "right" library.

In short, to pseudocode, with LibraryWeGot derived from open feedback on
a file:

WHILE LibraryWeWant <> LibraryWeGot
close all the files
shell out "RMVLIBLE " + LibraryWeGot
shell out "ADDLIBLE " + LibraryWeWant + "*LAST"
reopen all the files

(And EXTFILE clauses on the F-specs are not an option here, for reasons
I'd rather not go into.)

At any rate, I just discovered a loophole: if the file on which we're
getting the open feedback has a level check issue, the exception stops
us before we reach the block that checks to see if we're in the right
library.

Assuming I catch the exception, is there an easy way to find out what
"LibraryWeGot" is?

_______________


Confidentiality Notice: This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

________________

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.