Follow below steps to handle record lock:
-
Login to Green Screen
-
Enter command WRKACTJOB
-
Search for the job which is in 'MSGW' status
-
Take option 7=Display Message
-
Note down the object name, object library and object type mentioned in the error message
-
Enter command "WRKOBJLCK OBJ(LIBRARY/OBJNAME) OBJTYPE(OBJTYPE)" to check if lock still exists, where
LIBRARY is the name of the library noted down in step 5
OBJNAME is the name of the object noted down in step 5
OBJTYPE is the object type noted down in step 5
-
If object type is *FILE and there are no jobs displayed, press F6= Work with member locks to see if there are any locks at member level.
-
Based on the job locking the object, wait for the locking job to complete, or end the job.
If the locking job is a batch job, wait for it to complete.
If the locking job is interactive job, send a break message and wait for some time. In case of no response, it may be ended.
- Once all the locks are released, reply for the error message with "D" till "R" (Retry) option is shown. Reply with "R" if "R" option is available.
If the object is of type *FILE, this error may be prevented from occurring in future. To prevent this in future, File Wait time attribute on the file can be increased to prevent hard errors, when the locks are temporary, from other processes. If the File Wait time is increased, the job would wait for the specified amount of time to obtain the lock instead of displaying error message immediately.
File Wait time can be increased using the one of the below commands.
For PF - CHGPF FILE(FILENAME) WAITFILE(nnn)
For LF - CHGLF FILE(FILENAME) WAITFILE(nnn)
where nnn is the number of seconds of your choice.