How can i release the lock on a AS/400 file
20 pts.
0
Q:
How can i release the lock on a AS/400 file
I want to clear one file. But the message says that it is under use. The lock is under my profile but I am not using the file at that point of time. As of now I am killing the session and releasing the file. Have any one experienced this before? Can any body help me?

Software/Hardware used:
AS400
ASKED: Aug 28 2009  5:55 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
7355 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Hi Sreeraj,

How one can find out what is causing a lock you should do the following:

1) Before your job place 5
2) Choose option 12
3) You will see a list of all objects used by you
4) If there are any objects showing member locks "YES"
5) Type 8 in front and find out which file is being locked by whom.
6) Contact the owner of the file that's causing the lock if present to find out more or if it's a job that runs daily there is no other option then to wait until that file has been released.

If this answers your question then it's O.K.

Good luck!

Roy

----------------
The lock is under your profile
DSPUSRJOBs - if you have any batch jobs running they maybe creating the lock
Signoff interactive jobs to release the locks.
The program that you are running isn't closing the file or setting *INLR on
Phil

====================================================================

The establishment of the lock might have come from calling a program that created an activation group that hasn't been reclaimed -- regardless of *INLR on or off.
DSPJOB  OPTION( *ACTGRP )

Or take option 18 from the DSPJOB menu. You might be able to RCLACTGRP for ones that you know can be reclaimed.

A more intense option is to try RCLRSC if you can't see any activation groups that might be an issue.

Have the file opens and closes journaled for a while if you'd like to track down whatever might be involved.

Tom
Last Answered: Oct 16 2009  0:05 AM GMT by TomLiotta   7355 pts.
Latest Contributors: Philpl1jb   24520 pts., 4819   235 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Sreeraj   20 pts.  |   Aug 28 2009  8:32AM GMT

Hi Roy,

Thanks for ur reply. Actually i had already done WRKOBJLCk on it and found out that the file was locked by my profile itself. But I was not using that file at that time , not running any jobs also. Still it shows that the file is locked. this happens right after running a particular program in my profile. But program successfully came out after running . but files are not getting released.

 

Whatis23   4040 pts.  |   Aug 28 2009  4:54PM GMT

If the file was opened by the OPNDBF or OPNQRYF commands, the Close File (CLOF) command will close a database file opened with those commands. Try this to release the lock.

 

TomLiotta   7355 pts.  |   Oct 11 2009  11:16AM GMT

Try a basic RCLRSC to force files to close.

Note that this should only be done if you’re sure the file doesn’t need to be open. There might be an activation group that expects the file to remain open. There might have been a trigger program that expects the file to stay open. There might be an exit program registered against any number of system exit points that expects the file to stay open.

There shouldn’t be functions that leave files open when you need to establish locks on the files in other functions. Either the file is left open by mistake or you shouldn’t be locking it. Either way, something needs to be fixed.

Tom

 
0