CL Command Reference - CLRLIB

CL Command List > CLRLIB Reference

Description:

The Clear Library (CLRLIB) command deletes all of the objects that you have the authority to delete from the specified library. This command does not delete the specified library, only the objects in it for which you have object existence (*OBJEXIST) authority. The other objects remain in the library. If any object in the library is in use (locked by another thread or job), the object cannot be deleted.

Restrictions:

1. You must have object existence (*OBJEXIST) authority for every object being deleted and use (*USE) authority for the library.

2. This command cannot be used to clear the QRECOVERY, QRCYxxxxx, QSPL, QSPLnnnn, QSYS, QSYSxxxxx, QSYS2, QSYS2xxxxx, QSYSCGI, 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 or a primary or secondary ASP.)

3. This command is conditionally threadsafe. The following restriction applies: v In multithreaded jobs, this command is not threadsafe for distributed files and fails for distributed files that use relational databases of type *SNA.


Examples:

Example 1: Clearing a Library

CLRLIB LIB(A)

This command deletes all objects in library A that are not in use and for which you have object existence (*OBJEXIST) authority.



Example 2: Deleting a Library in an Independent Auxiliary Storage Pool (ASP)

CLRLIB LIB(INVENTORY) ASPDEV(SALES)

This command deletes all objects in library INVENTORY in the independent auxiliary storage pool (ASP) named SALES that are not in use and for which you have object existence (*OBJEXIST) authority. The SALES ASP must have been activated (by varying on the ASP device) and have a status of ¡¯Available¡¯.