Link to home
Start Free TrialLog in
Avatar of evel1959
evel1959Flag for United States of America

asked on

How do I find all files locked in a specified set of libraries, to ensure my backups run?

I am trying to determine how I can obtain a quick report of all files locked in a specific set of libraries.  The reason I need this is that I never know util after my backup runs whether or not there is a lock on a file.  Once the backup is complete, then it's a major issue in some cases to backup only the files that were missed because of file locks.  I have been supporting this AS400 for 6 years and I know enough to keep it running, but am in no way a guru and have not had any significant training on all the commands and how to use them.  It just seems to me that there should be a way to do this.
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of evel1959

ASKER

Thanks for the guidance.  I appreciate the help.  I was hoping to have something that would quickly check all objects in a library set, but I can see that it would probably be too much work.  I think I'll invest my time in the manual provided.
Tom is right, of course:

ALCOBJ is a better solution than CHKOBJ in many cases:

CHKOBJ checks to see if RIGHT AT THAT SECOND a lock exists.

ALCOBJ actually grabs a lock of the type that you specify on an object, and holds it until you either explicitly release the lock using the DLCOBJ command, or until the job allocating the object ends.

- Gary Patterson
Avatar of Member_2_276102
Member_2_276102

ALCOBJ also nowadays has the CONFLICT() parameter which can be of real use in situations like this thread.

Tom