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!

Display User Who Has Record Locked 2

Status
Not open for further replies.

bcd31

Programmer
Jul 18, 2003
1
US
Is there anyway in RPG/400 to display to "user1" the name of "user2" who currently has the record locked that "user1" is trying to access?
 
WRKACTJOB

should show you all active jobs along with the user that is currently running the job

____________________________________________________
[sub]Python????? The other programming language you never thought of!
thread333-584700[/sub]
onpnt2.gif
 
WRKOBJLCK OBJ(MYFILE) OBJTYPE(*FILE)

Will give you a list of all the jobs with a lock on a file. Then option 5 followed by option 14 will tell you which record is locked.


--------------------------------
If it ain't broke, don't fix it!
 
Use:

If %Status = 01218

after a chain to detect a record lock in RPG IV.

 
One thing, suppose the program detects a record lock. Great, now what? Do you exit the program, do you send a message to the user, what are your program actions now?
Thanks,
Frank
 
Depends totally on the purpose of your program, but we had something a while ago that did a SNDUSRMSG with a reply value of R (retry) or C (cancel) specified. The program then did a loop until the update was successful or until the user replied option C.

PeteJ
(Contract Code-monkey)

It's amazing how many ways there are to skin a cat
(apologies to the veggies)
 
Going back to the original question posted, is there a way of grabbing the identity of the account that has the record locked and displaying it to a user within a program?

In other words can it be automated rather than relying on somebody typing in a command in the command line?
 
Good articles and thanks for introducing me to an excellent tip site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top