×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Remote WRKOBJLCK

Remote WRKOBJLCK

Remote WRKOBJLCK

(OP)
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

RE: Remote WRKOBJLCK

Does it mean that you want to get the files listed on the Work With Job panel opt 12 ?
Can you clarify ?

RE: Remote WRKOBJLCK

(OP)
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.

RE: Remote WRKOBJLCK

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
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp

 

RE: Remote WRKOBJLCK

(OP)
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

RE: Remote WRKOBJLCK

ok. Where's the new thread ? Can't find it.

RE: Remote WRKOBJLCK

(OP)
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

RE: Remote WRKOBJLCK

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close