Use the OBJECT_LOCK_INFO view.

If I run this for a display file that I am using.

I get this.

If no one is in the file I get no records.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of JRusling@xxxxxxxxxxx
Sent: Monday, January 28, 2019 2:00 PM
To: RPG programming on the IBM i(AS/400 and iSeries)
Subject: Re: How can i test, from rpg, if a display file is in use?

I have used similar method myself.

I'm creating an 'Unlock process' program.

The locked process has a data area that needs to be cleared -- so that another user may initiate/use the (locked) process.

I can do this easily from my 'Unlock process' program, but . . .

My thought was to further insure that the process wasn't really in use...
i could see if the display file, used to initiate it, was open/in use.
(i was thinking that should be fairly easy to do)

The process that gets locked is only ever rarely actually locked.

Why it happens --
A user either exits the 5250 session abnormally or stays signed on so long that the nightly backup kicks their session off.

It would probably just be easier to throw a job in, at the end of nightly backups, to clear the data area.

Thanks Jose,


Another way I have seen is people sometimes use a data area with a flag when screen open flag equal 1 and then all programs using this screen check that flag in this dtaarea.

On Mon, Jan 28, 2019, 2:14 PM Jose Perez <
<br />
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support by shopping at with our affiliate link:

[] Kevin Bucknum
Senior Programmer Analyst
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550


This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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