DLTLIB (Delete Library)
Purpose
The Delete Library (DLTLIB) command deletes a specified library from the system after all objects in the library have been deleted. If a library being deleted contains objects, this command first deletes all of the objects and then deletes the library. If the user submitting this command does not have the authority to delete every object in the library, only those for which the user has the authority are deleted. In this case, the library and all the other objects in the library do not change. If any object in the library is in use (locked to a program) when this command is entered, the object cannot be deleted.
If a library has been damaged, the user should not delete it without first trying to resolve the damage. In most cases, the damage can be resolved by starting the initial program load (IPL) sequence to rebuild a user library (including the QGPL library). Then, if the library is still damaged, it should be deleted. Either a saved version of the library can be restored in its place or the library can be recreated.
Restrictions
- To delete a library, the user must have use and object existence authority for the specified library and object existence authority for every object in it. If the user does not have object existence authority for the library, nothing is deleted. If the user does not have object existence authority for one or more objects in the library, those objects and the library are not deleted.
- The user must have *USE authority to the auxiliary storage pool (ASP) device if a specific ASP device name is specified on the ASPDEV parameter.>
- A library cannot be deleted if it is in the library list of the current thread.>
- A library cannot be deleted if it is in the library list of any primary thread that is active on the system when the QLIBLCKLVL system value is set to lock libraries in the library list.>
- This command cannot be used to delete the QQALIB, QRECOVERY, QRCYxxxxx, QSPL, QSPLnnnn, QSYS, QSYSxxxxx, QSYS2, QSYS2xxxxx, QSYSCGI, QTEMP, SYSIBM, or SYSIBxxxxx libraries (where 'xxxxx' is the number of a primary auxiliary storage pool (ASP) and 'nnnn' is the number of a basic user ASP.) >
- If the library QDOC is deleted, it is created again during the next IPL.
- This command is conditionally threadsafe. The following restrictions apply:
- In multithreaded jobs, this command is not threadsafe for distributed files and fails for distributed files that use relational databases of type *SNA.
Required Parameters
- LIB
- Specifies the name of the library to be deleted.
Optional Parameters
- ASPDEV
- Specifies the auxiliary storage pool (ASP) device name where storage is allocated for the library being deleted (LIB parameter). If the library is in an ASP that is not part of the thread's library name space, this parameter must be specified to ensure the correct library is the target of the delete library operation.
*: The ASPs that are currently part of the thread's library name space will be searched to locate the library. This includes the system ASP (ASP 1), all defined basic user ASPs (ASPs 2-32), and, if the thread has an ASP group, the primary and secondary ASPs in the ASP group.
*CURASPGRP: If the thread has an ASP group, the primary and secondary ASPs in the ASP group will be searched to locate the library. The system ASP (ASP 1) and defined basic user ASPs (ASPs 2-32) will not be searched.
*SYSBAS: The system ASP (ASP 1) and all defined basic user ASPs (ASPs 2-32) will be searched to locate the library. No primary or secondary ASPs will be searched, even if the thread has an ASP group.
auxiliary-storage-pool-device-name: The device name of the primary or secondary ASP to be searched to locate the library. The primary or secondary ASP must have been activated (by varying on the ASP device) and have a status of 'Active' or 'Available'. The system ASP (ASP 1) and defined basic user ASPs (ASPs 2-32) will not be searched.>
Example for DLTLIB
DLTLIB LIB(W)This command deletes library W after all of its objects have been deleted. If library W contains objects and the user has the authority to delete all of those objects, library W and all of the objects are deleted. If the user does not have authority to delete all of the objects, only those for which he has authority are deleted and the library is not deleted.
Error messages for DLTLIB
*ESCAPE Messages
- CPFA030
- Object already in use.
- CPFB8ED
- Device description &1 not correct for operation.>
- CPF210D
- Library &1 in use.
- CPF2110
- Library &1 not found.
- CPF2113
- Cannot allocate library &1.
- CPF2129
- Clear or delete of system library &1 canceled.
- CPF2161
- Cannot delete some objects in library &1.
- CPF2166
- Library name &1 not valid.
- CPF2167
- Library &1 on library list and cannot be deleted.
- CPF2168
- Library &1 not deleted.
- CPF218C
- &1 not a primary or secondary ASP.>
- CPF2182
- Not authorized to library &1.
- CPF8122
- &8 damage on library &4.
- CPF9814
- Device &1 not found.
- CPF9825
- Not authorized to device &1.
- CPF9833 E
- *CURASPGRP or *ASPGRPPRI specified and thread has no ASP group.