When you delete a library with the Delete Library (DLTLIB) command, you delete the objects in the library as well as the library itself.
When you clear a library with the Clear Library (CLRLIB) command, you delete objects in the library without deleting the library. To delete or clear a library, all you need to specify is the library name. For example:
DLTLIB LIB(DISTLIB)
CLRLIB LIB(DISTLIB)
To delete a library, you must have object existence authority for both the library and the objects within the library, and use authority for the library. If you try to delete a library but do not have object existence authority for all the objects in the library, the library and all objects for which you do not have authority are not deleted. All objects for which you have authority are deleted. If you try to delete a library but do not have object existence authority for the library, not only is the library not deleted, but none of the objects in the library are deleted. If you want to delete a specific object (for which you have object existence authority), you can use a delete command for that type of object, such as the Delete Program (DLTPGM) command.
You cannot delete a library in an active job's library list. You must wait until the end of the job before the deletion of the library is allowed. Because of this, you must delete the library before the next routing step begins. When you delete a library, you must be sure no one else needs the library or the objects within the library.
The Change System Library List (CHGSYSLIBL), Add Library List Entry (ADDLIBLE), Edit Library List (EDTLIBL), and Remove Library List Entry (RMVLIBLE) commands are also used to change the library list.
To clear a library, you must have object existence authority for the objects within the library and use authority for the library. If you try to clear a library but do not have object existence authority for all the objects in the library, the objects you do not have authority for are not deleted from the library. If an object is allocated to someone else, it is not deleted.