“Clearing a file lock” means that the entry in the file lock table is deleted. This can be done using the VERIFY function (VERIF macro or REMOVE-FILE-ALLOCATION-LOCKS command). A file can be unlocked with this macro or command only if the job processing the file is permanently inactive and the file was locked by means of the SECURE-RESOURCE-ALLOCATION command or if the file is a tape file.
Files on a shared pubset may be locked after a system crash.
Disk files that were not locked by the SECURE-RESOURCE-ALLOCATION command can be unlocked only by systems support, under the user ID TSOS. To do this, systems support must first ensure that no one is working with the file.
Disk files which have already been unlocked are treated by the VERIF macro and REPAIR-DISK-FILE command in different ways, depending on the access method with which they were created.
SAM files: the last-page pointer in the catalog entry is updated, which means that the file can be opened again even in EXTEND mode. However, any records which were located in the I/O buffer when the job was aborted and which had not been transferred to the file may be lost (see section "Recovery limits").
ISAM files: all records that can be recovered are written into a new ISAM file (the recovery file); data blocks which cannot be interpreted are written into a PAM file (see section "Recovery limits").
The user may specify which file is to be used as the recovery file. If this file is on a private disk, there must be sufficient storage space available. If the user specifies a recovery file in the VERIF macro or REPAIR-DISK-FILE command, the damaged file is not overwritten or erased.
If the user does not specify a recovery file, the ISAM file is recovered in a work file on public volumes. The subsequent processing of the original file and the work file depends on the type of volumes on which the damaged file was stored.
If the damaged file was on public volumes, it is erased (but, for performance reasons, without data destruction) and the work file is renamed with the name of the original file.
If the damaged file was on private volumes, it is overwritten with the contents of the work file. Then the work file is erased (here, for data protection reasons, with data destruction).
PAM files: DMS executes a privileged close operation and then updates the last-page pointer.
The last-page pointer is set to the last occupied page for files for which BLOCK-CONTROL-INFO=NO has been specified. Files with BLOCK-CONTROL-INFO=WITHIN-DATA-BLOCK are read backwards, and the last-page pointer is set to the last page that belongs logically to the file. This may be very time-consuming in the case of large files.
The last-byte pointer is set to zero.