Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote WRKOBJLCK

Status
Not open for further replies.

jsplice

Programmer
Jun 3, 2003
88
US
Hello all. I've been trying to find a way to remotely check for an object lock. I've looked through the APIs but haven't come across anything yet that can do this. The reason for needing to do this is that I'm planning to install a lot of indicies to many production files that are locked at most times. I'd like to leave a continuous job running on our development system the checks these files every 30 seconds or so on the remote production system and does some logging to tell me at which times during the week these files are unlocked so that I can plan my install accordingly.

Does anyone have any ideas on how to do this, or know if this is even possible?

Thanks
 
Does it mean that you want to get the files listed on the Work With Job panel opt 12 ?
Can you clarify ?
 
No. I want to retrieve locks on a particular file, but not the file locks created by a particular job. This would be the same as if you were to do WRKOBJLCK filename *FILE. You could then do F6 to get a list of specific member locks. It would be nice to record which particular job is locking a member in the file, but as long as I can at least find out that the file is locked, that is good enough. I haven't been able to find a way to do this remotely.
 
So you have to create a program which
1/ gets a list of currently active job's files (QUSLJOB API) into a user space (QUSCRTUS API along with QUSPTRUS API),
2/ for each listed job, retrieves the active (open) database files (use QUSRJOBI API along with QDMLOPNF API),
3/ checks the lock state for each retrieved file (QWCLOBJL API),
4/ for each locked file, do the loggin stuff you want and put it in a file.

Submit a CL that runs every n seconds and calls the newly created RPG program.

Best of luck !

For details on APIs check out the IBM Infocenter at
 
Thanks for the help. I've put together a program that successfully uses this API. But now I am posing another question. I've created another thread for it.

Thanks
 
Sorry I got caught up in work and never got around to it. I was going to ask how to call a procedure remotely, but there is no clear cut way to do it. I see "Scott Klement" has some uncompleted source on his site that attempts to implement remote procedure calls in RPG. I opted to just "sneak" my monitoring program and file onto the production system, then have a continuously running job on our development box that submits that remote job every 60 seconds to check for the object locks....

Thanks,

John
 
This is what I'd opt for too. You could have a hard time trying to call the remote procedure. However when the program terminates and before the next call you could ftp the remote file to the developement system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top