| Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Delete Object (DLTOBJ) command can be used to delete objects of an object type listed in the object type (OBJTYPE) parameter. Many, but not all, of the library-based external object types on the system can be deleted using this command. Unlike other DLTxxx commands, this command does not support any unique parameters for a specific object type. The DLTxxx command for the object type (if one exists) should be used if special parameter values need to be specified for an object type.
The DLTOBJ command has some advantages over the DLTxxx commands:
For information about the object and library authorities and locks refer to the Delete Object (QLIDLTO) API in the APIs topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. The QLIDLTO API is the command processing program (CPP) for this command.
Restrictions:
| Top |
| Keyword | Description | Choices | Notes |
|---|---|---|---|
| OBJ | Object | Qualified object name | Required, Positional 1 |
| Qualifier 1: Object | Generic name, name, *ALL | ||
| Qualifier 2: Library | Name, *LIBL, *CURLIB, *USRLIBL, *ALL, *ALLUSR | ||
| OBJTYPE | Object type | *ALRTBL, *AUTL, *BNDDIR, *CFGL, *CHTFMT, *CLD, *CLS, *CMD, *CNNL, *COSD, *CRQD, *CSI, *CSPMAP, *CSPTBL, *CTLD, *DEVD, *DTAARA, *DTADCT, *DTAQ, *EDTD, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *IMGCLG, *IPXD, *JOBD, *JOBQ, *JRN, *JRNRCV, *LIB, *LIND, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODD, *MODULE, *MSGF, *MSGQ, *NODGRP, *NODL, *NTBD, *NWID, *NWSCFG, *NWSD, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SQLXSR, *SRVPGM, *SSND, *TBL, *TIMZON, *USRIDX, *USRQ, *USRSPC, *VLDL, *WSCST | Required, Positional 2 |
| ASPDEV | ASP device | Name, *, *ALLAVL, *CURASPGRP, *SYSBAS | Optional |
| RMVMSG | Remove message | *NO, *YES | Optional |
| Top |
Specifies the objects which you want to delete and the library or libraries from which the objects are to be deleted.
This is a required parameter.
Qualifier 1: Object
Note: System library names such as library QSYS are allowed, but be very careful about specifying a system library name with an object name of *ALL.
Qualifier 2: Library
User libraries are all libraries with names that do not begin with the letter Q except for the following:
#CGULIB #DSULIB #SEULIB #COBLIB #RPGLIB #DFULIB #SDALIB
Although the following libraries with names that begin with the letter Q are provided by IBM, they typically contain user data that changes frequently. Therefore, these libraries are also considered user libraries:
QDSNX QRCLxxxxx QUSRDIRDB QUSRVI QGPL QSRVAGT QUSRIJS QUSRVxRxMx QGPL38 QSYS2 QUSRINFSKR QMGTC QSYS2xxxxx QUSRNOTES QMGTC2 QS36F QUSROND QMPGDATA QUSER38 QUSRPOSGS QMQMDATA QUSRADSM QUSRPOSSA QMQMPROC QUSRBRM QUSRPYMSVR QPFRDATA QUSRDIRCF QUSRRDARS QRCL QUSRDIRCL QUSRSYS
| Top |
Specifies the type of object which you want to delete.
To see a complete list of object types when prompting this command, position the cursor on the field for this parameter and press F4 (Prompt). For a description of the object types, see "Object types" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
This is a required parameter.
| Top |
Specifies the auxiliary storage pool (ASP) device name where storage is allocated for the library containing the object. If the library resides 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 searched. If this parameter is used when the library qualifier specified for the Object (OBJ) parameter is *CURLIB, *LIBL, or *USRLIBL, ASPDEV(*) is the only valid value.
Specify the name of the primary or secondary ASP device to be searched. The primary or secondary ASP must have been activated (by varying on the ASP device) and have a status of 'Available'. The system ASP (ASP 1) and defined basic user ASPs (ASPs 2-32) will not be searched.
Note: To specify a specific auxiliary storage pool (ASP) device name, you must have use (*USE) authority for each ASP device in the ASP group.
| Top |
Specifies whether or not to remove completion and informational messages related to the deletion of objects from the job log. Messages are only removed if the object was successfully deleted. Diagnostic and escape messages are not removed for objects that could not be deleted.
| Top |
Example 1: Delete all user spaces in a library
DLTOBJ OBJ(MYLIB/*ALL) OBJTYPE(*USRSPC) ASPDEV(*) RMVMSG(*NO)
This command deletes all of the user spaces from the library MYLIB if the user has the proper authority for the user spaces and the library.
Example 2: Delete all libraries of a generic name on the system
DLTOBJ OBJ(QSYS/TESTLIBXY*) OBJTYPE(*LIB) ASPDEV(*ALLAVL)
This command deletes all libraries that have a name starting with TESTLIBXY on all available ASPs if the user has the proper authority.
| Top |
| Top |