Would it not make more sense to:

RMVLIBLE LibraryWeWant (using a MonMsg to catch the case where
LibraryWeWant is not already in the LIBL)
ADDLIBLE LibraryWeWant *FIRST
BEFORE opening any files?

Also, the code you have below will try to add LibraryWeWant *LAST more
than once.if the file is in more than one library already in your LIBL.

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?

--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.