Cancel file lock
Component: | BS2000 |
Functional area: | File processing |
Domain: | FILE |
Privileges: | STD-PROCESSING |
Function
The command REMOVE-FILE-ALLOCATION-LOCKS enables files (and also file generations or file generation groups), which have been incorrectly closed due to a system crash or aborted job, to be made accessible again. The command enables the user to cancel any file lock imposed as a result of a system crash or the abortion of a job.
A file lock can be canceled with the REMOVE-FILE-ALLOCATION-LOCKS command only if the job which produced the lock was terminated by the system with the message “TASK PENDED INDEFINITELY” on the operator’s console.
For tape files which were exclusively reserved by a SECURE-RESOURCE-ALLOCATION command, the user may request the removal of the lock; for disk files, only the system administrator is authorized to do so.
The REMOVE-FILE-ALLOCATION-LOCKS command does not reconstruct the files in question. This may be initiated with the REPAIR-DISK-FILES command if required. The CHECK-FILE-CONSISTENCY command removes a file lock and check the file for inconsistencies at the same time.
Concurrent copy locks
Concurrent copy locks must not be removed unless the concurrent copy session has been completed. There are two different cases to consider:
If both file locks and concurrent copy locks exist, the return code depends on whether it was possible to reset the file locks.
If there is only a concurrent copy lock, the return code depends on whether it was possible to reset the lock.
Privileged functions
Systems support (TSOS privilege) can, in addition to specifying any required file, also reset the NO-OPEN-ALLOWED bit in the TSOSCAT, which prevents the file from being opened.
Format
REMOVE-FILE-ALLOCATION-LOCKS |
FILE-NAME = <filename 1..54> / <partial-filename 2..53> ,SELECT = *ANY-VOLUME / *PRIVATE-DISK / *PUBLIC-DISK / *NET-STORAGE ,OPEN-ALLOWED = *UNCHANGED / *YES |
Operands
FILE-NAME = <filename 1..54> / <partial-filename 2..53>
The name of the file which is locked. This may be a permanent file or a temporary one, or a file generation group or a file generation. Write access is required for files which are not under the user’s own user ID.
If a partially qualified file name is specified, only the files which are identified as open will be selected. If exactly one file is specified, the file is selected without taking this identifier into account.
For tape input files: If the locked file was opened in INPUT or REVERSE mode, the fully qualified file name must be specified; the file lock is removed.
The following actions are performed based on the access method with which the file was created:
PAM files: Only the file lock is removed. If the file is identified as open, it remains open, i.e. continues to be displayed by SHOW-FILE-ATTRIBUTES with STATUS=*PAR(CLOSED-OUTPUT=*YES); for REPAIR-DISK-FILES, the file is still regarded as a file that needs repair. This means that it will also be listed as a file that needs reconstruction in the output of the SHOW-FILE-ATTRIBUTES command (with the STATUS=*PAR(REPAIR-NEEDED= *YES) option).
SAM files: The file lock is removed. If the file is identified as open, no privileged close operation is performed, i.e. in the case of SHOW-FILE-ATTRIBUTES with STATUS=*PAR( CLOSED-OUTPUT=*YES) it is still displayed; for REPAIR-DISK-FILES it is regarded as a file to be repaired. This means that it will also be listed as a file that needs reconstruction in the output of the SHOW-FILE-ATTRIBUTES command (with the STATUS=*PAR(REPAIR-NEEDED= *YES) option).
ISAM files: The file lock is removed. If the file is identified as open, the last page pointer is set to the highest PAM page written. If the file is on a mirrored disk (see the “DRV” manual [11]), the consistency (contents) of file blocks is restored if required. Inconsistencies between the index and data sections and for secondary keys are not detected and are not removed. The file is no longer regarded as a file requiring repair, i.e. will not be shown by SHOW-FILE-ATTRIBUTES with STATUS=*PAR(REPAIR-NEEDED=*YES).
SELECT = *ANY-VOLUME / *PRIVATE-DISK / *PUBLIC-DISK
Restricts the files selected for closing to the specified volume type. This operand is only meaningful if FILE-NAME was a partially qualified name, or the name of a file generation group.
SELECT = *ANY-VOLUME
The specified files will be selected, irrespective of the volume on which they are held.
SELECT = *PRIVATE-DISK
Of the specified files, those which are held on private disk will be selected.
SELECT = *PUBLIC-DISK
Of the specified files, those which are held on public disk will be selected.
SELECT = *NET-STORAGE
Of the specified files, those which are held on Net-Storage volume will be selected.
OPEN-ALLOWED = *UNCHANGED / *YES
This parameter enables systems support to specify that the NO-OPEN-ALLOWED bit in the catalog entry, which prevents a file from being opened, is reset for the specified file. The file can subsequently be opened again.
Return codes
(SC2) | SC1 | Maincode | Meaning |
---|---|---|---|
0 | CMD0001 | Command executed | |
1 | 0 | CMD0001 | No action required |
2 | 0 | DMS06E6 | File specified in command is empty |
2 | 0 | DMS06E9 | No valid record found during reconstruction of ISAM file |
2 | 0 | DMS06ED | Error on writing unrecoverable blocks to scratch file |
1 | CMD0202 | Syntactical or semantic error in command | |
32 | DMS0584 | A state that does not allow the function to continue was reported during processing | |
64 | CMD0216 | Privileges error | |
64 | DMS0501 | Requested catalog not available | |
64 | DMS051B | Requested user ID not in pubset | |
64 | DMS051C | User not authorized to access pubset | |
64 | DMS0533 | Requested file not cataloged in pubset | |
64 | DMS0535 | Specified file not shareable | |
64 | DMS055C | Catalog entry not found on assigned private disk | |
64 | DMS0583 | An error occurred when reconstructing the file | |
64 | DMS0585 | Error detected during catalog processing or multihost processing | |
64 | DMS0586 | Currently not possible to access or reserve volume | |
64 | DMS0587 | Use of specified command restricted by system administrator | |
64 | DMS0588 | It was not possible to allocate disk space | |
64 | DMS05F8 | It was not possible to allocate disk space | |
64 | DMS05FC | Specified user ID not in HOME pubset | |
64 | DMS0609 | No access to system file | |
64 | DMS0609 | No access to system file | |
64 | DMS06CC | No file corresponding to the specified operands | |
64 | DMS06E4 | Reconstruction with specified command not possible for this file type | |
64 | DMS06FF | Reconstruction for this file type not possible with specified command | |
64 | DMS06FF | File created with WROUT=NO. Consistency check is not practical | |
130 | DMS0524 | System address space full | |
130 | DMS053C | No space in pubset catalog file | |
130 | DMS0582 | File is currently locked or in use and cannot be processed | |
130 | DMS0585 | Error detected during catalog processing or multihost processing | |
130 | DMS0586 | Currently not possible to access or reserve volume | |
130 | DMS0588 | It was not possible to allocate disk space | |
130 | DMS0594 | Not enough virtual memory available | |
130 | DMS05C8 | Maximum permitted number of files reached |