Command reference / library
CLRLIB
Clear Library
Deletes all objects in the specified library for which you have object existence (*OBJEXIST) authority. The library itself is not deleted. Objects you lack *OBJEXIST authority for, and objects in use (locked by another thread or job), remain in the library.
Allowed environments: *ALL.
Positional parameters: 1.
Restrictions
- Requires *OBJEXIST authority for every object deleted and *USE authority for the library.
- Cannot clear IBM system libraries. Message CPD2103 is sent if one is specified and the command is not run.
- Conditionally threadsafe. In multithreaded jobs it is not threadsafe for distributed files, and it fails for distributed files that use relational databases of type *SNA.
Parameters
LIB
Library
Specifies the library to be cleared. Objects for which you lack *OBJEXIST authority remain. If QGPL is specified or defaulted through *CURLIB, inquiry message CPA2129 asks you to verify the clear.
Suggested / special values:
*CURLIB
*CURLIB- The current library for the thread is cleared. If the thread has no current library, QGPL is cleared.
ASPDEV
ASP device
Specifies the auxiliary storage pool (ASP) device where storage for the library is allocated. Required if the library is not part of the thread's library name space. With *CURLIB for LIB, only ASPDEV(*) is valid.
Suggested / special values:
*, *CURASPGRP, *SYSBAS
*- Searches the ASPs in the thread's library name space: ASP 1, ASPs 2-32, and, if the thread has an ASP group, its primary and secondary ASPs.
*CURASPGRP- Searches the primary and secondary ASPs in the thread's ASP group. ASP 1 and ASPs 2-32 are not searched.
*SYSBAS- Searches ASP 1 and all basic user ASPs (2-32). No primary or secondary ASPs are searched, even if the thread has an ASP group.
Examples
CLRLIB LIB(A)
Deletes all objects in library A that are not in use and for which you have *OBJEXIST authority.
Generated from os/cl/catalog/CLRLIB.json and os/cl/help/CLRLIB.json.