• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1006
  • Last Modified:

Object Locks

Dear Team,

We are trying to read datas from one file which is logical file?
If I am giving authority to that logical file, is the Authority to the logical file is sufficient to read the
file? In that case I am not giving authority to the Physical file?

Specific Physical file having 125 logical files, If i want to give authority to any one of the file means both the Physical and Logical files should not be in lock?
If it is so means, how to find the other locked objects of the specific file?
Is their any way to find the locked objects of that file?


Thanks
BSID team....
0
Bsidmis
Asked:
Bsidmis
  • 2
  • 2
3 Solutions
 
LewisPowerCommented:
Hi BSID team,

By using WRKOBJLCK OBJ(LIBXXX/ABCD) OBJTYPE(*FILE) MBR(*ALL) command, you should have all the possible locks on the file.

Lewis
0
 
BsidmisAuthor Commented:

Hi Lewis,
WRKOBJLCK OBJ(LIBXXX/ABCD) OBJTYPE(*FILE) MBR(*ALL)
By this command I am able to see who locked that file, but I dint get the file names which is locked?
And one more thing, Logical file authority is sufficient to read the file or we want to give
authority to both physical and logical file?
Do the need full for this question?

thanks
BSID team
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
There are several ways to find which logical files are causing a lock on a particular physical file:

1) DSPDBR for the physical, and then WRKOBJLCK for each of the listed logicals.  You could also write a little CL to do this.
2) WRKOBJLCK MEMBER(*ALL) on the physical, and use option 8 to see job locks for each job.  The job-level locks will show which logical is causing the physical lock.

Technically,  a user must have data authority to both the physical file and the logical file in order to access the data.  It is possible to use logical files as a mechanism to limit access to the underlying physical, though:

1) Grant the appropriate data authorities to the physical file and the logical file to the user(s) or group(s) in question.
2) Revoke *OBJOPR authority to the physical file to prevent the user from accessing the physical file directly.

- Gary Patterson
0
 
BsidmisAuthor Commented:
hi,,
Through commands it is very difficult to check the object locks,.
Because Our Physical file contains 125 logicals and they are user by more than 20 users, so to check the lock we want to write one program..
After Wrkobjlck command in CLLE, how it possible to give the '8' option programatically,
Since they are IBM defined files, and we dont know the Display files, etc..
Is their any other way , to find the lock of Particular objects in programming?
i.e . Incase of 1 PF having more than 100 logicals..
Give us any solution to this problem?
 
Thanks
BSID team
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
If you want a fully-automated solution, then I suggest the following approach:

1) Use DSPDBR OUTPUT(*OUTFILE) to generate a list of all of the related logicals for a given physical.
2) Create a user space using the QUSCRTUS API to hold lock info from the QWCLOBJL api, below.
2) Code a loop that reads the output file and calls the QWCLOBJL API for each logical listed in the outfile.
3) Retrieve the user space, display or print the contents, and delete the user space.  I've provided links the relevant API documentation below.

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/qwclobjl.htm
http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/apis/quscrtus.htm
http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/apis/obj5.htm

- Gary Patterson
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now