Yes, these are very different although you might see both happening at about the same time.
File locks like other types of object locks are locks on the entire object.
An RPG F spec with Update will lock the file member to Shared – Update status when the file is opened.
It can also be locked with the ALCOBJ command.
Other processes can use the member for input, output, update but no process can establish an exclusive lock or an exclusive allow read lock or delete the object while that lock is in place. The lock from the F-spec will be in place from the time the file is opened until it’s closed.
Record locks are an entirely different process.
Your F-spec or open command opens the file for update but doesn’t lock a record.
The read or chain locks a record (on a file open for update), unless the read or chain uses (n) – no lock.
The single record remains locked until
- an unlock is issued
- an update or delete is issued
- another read or chain is issued.
- the file is closed or *inlr set on.
Record locks will remain longer with commitment control.
The program will be prevened from allocating a record that is locked by another process.
An RPG-f spec with input mode will lock the file member as Shared-read but will not lock any records.
Shared-read will allow any use of the file by other processes except those that requre exclusive locks or that delete the file.