This is exactly the kind of question that is most easily and best answered by opening a Support Incident (PMR) with IBM.
Mark S. Waterbury

On Wednesday, January 13, 2021, 8:24:48 PM EST, Jay Vaughn <jeffersonvaughn@xxxxxxxxx> wrote:

So I’ll take a wild guess... :)
There is no unlocking my ifs file while I’m sitting in the exit pgm for qibm_qp0l_scan_OPEN exit point??? :)


On Jan 13, 2021, at 7:34 PM, Jay Vaughn <jeffersonvaughn@xxxxxxxxx> wrote:

I’ll dig a little more to find out exactly why but a little more background...
I am in an rpg exit pgm on qibm_qp0l_scan_open exit point.
The program has already done some other “things” with the ifs file (in which I’ll get more details on).
In debug I sit on my breakpoint where I then try and clear the ifs file via an in house api (in which I need more detail on), but it responds that the stream file is locked.
I attempted a close() just prior to that in which the close() failed as well.
I then also issued a RLSIFSLCK and tried a CHKIN just before the close() in debug and that did not unlock it either.

I run the qp0fptos pgm while in debug and it confirms my job has the ifs file locked.

So my question still stands... how do I unlock it from my current job (short of pgm and actgrp termination)?


On Jan 13, 2021, at 7:04 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:


When you say "an ifs file", I assume you mean a stream file, right?

Normally stream files aren't "locked" by someone else using them.  You can clear them or even delete them while someone else has them open.  This begs the question:  How is it locked?

Was this locked by using one of the O_SHARE_xxx flags on the open() API?  If so, the only way to release that lock is to close the open file.  This would normally be done by calling the close() API, but if for some reason that isn't possible (such as if the program crashed before it got to the close statement, and its not possible to resume where it left off) you could close it by ending the activation group.  Or, if somehow this was done in the default activation group (I hope not... but, it's possible) then you could end the job.

Or, was it locked by something like the CHKOUT command?  If so, the only way to release that is to run CHKIN.

Or... some other way?  We'll need to know what that is.


On 1/13/2021 5:45 PM, Jay Vaughn wrote:
So I’m in my rpg program and I’m needing to clear an ifs file but it’s currently locked to my own job.  Is there an api I can call to unlock it.
Rlsifslck, chkin, and closing the file are all out of the question. And as much as I would like to use a slick little sql statement (if possible) I’m not interested in that either.


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 On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 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.