Command reference / object
RNMOBJ
Rename Object
Changes the name of an object in a library. The new name must be unique for that object type in the library. An object that is in use is not renamed. If a library on an active user's library list is renamed, DSPLIBL shows the new name. Renaming a library can cause programming errors, so it is not recommended. If the object is journaled, a journal entry records the change.
Allowed environments: *ALL.
Positional parameters: 4.
Restrictions
- For objects other than *FILE: *OBJMGT authority on the object, and *UPD and *EXECUTE authority on the library containing it.
- For *FILE objects: *OBJMGT and *OBJOPR authority on the file, and *UPD and *EXECUTE authority on the library containing it.
- A library containing *CRG, *DTADCT, *JRN, *JRNRCV, *SQLPKG, *SQLUDT or *SQLXSR objects cannot be renamed.
- A PL/I program cannot be renamed after it is created.
- Configuration objects (controller, line, device and network interface descriptions) must be varied off before renaming.
- IBM system libraries, QSYSOPR, workstation user message queues, QHST, QCTL, QCONSOLE, the configuration lists and certain Electronic Customer Support objects cannot be renamed.
- A user library cannot be renamed to the name of an IBM system library.
- New names for *CSI, *GSS, *FNTRSC, *FORMDF, *OVL, *PAGDFN and *PAGSEG objects cannot exceed 8 characters.
- Conditionally threadsafe. Not threadsafe for distributed files on *SNA relational databases, for DDM *SNA files when SYSTEM(*RMT) or SYSTEM(*FILETYPE) is specified, and renames of *CFGL, *CNNL, *CTLD, *DEVD, *LIND or *NWID objects fail in multithreaded jobs.
Parameters
OBJ
Object
Specifies the object to be renamed. If the library is not specified, *LIBL is used. Specifying the library ensures the correct object is renamed. This is a required parameter.
*LIBL- All libraries in the thread's library list are searched until the first match is found. If ASPDEV is specified with this value, ASPDEV(*) is the only valid value.
*CURLIB- The current library for the thread is searched. If none is set, QGPL is searched. If ASPDEV is specified, ASPDEV(*) is the only valid value.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Object
Object
Library
Library
Suggested / special values:
*LIBL, *CURLIB
OBJTYPE
Object type
Specifies the object type of the object to be renamed. This is a required parameter.
Allowed values:
*ALRTBL, *AUTL, *BNDDIR, *CFGL, *CHTFMT, *CLD, *CLS, *CMD, *CNNL, *CRQD, *CSI, *CSPMAP, *CSPTBL, *CTLD, *DEVD, *DTAARA, *DTAQ, *EDTD, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IMGCLG, *IPXD, *JOBD, *JOBQ, *LIB, *LIND, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODULE, *MSGF, *MSGQ, *M36, *M36CFG, *NODGRP, *NODL, *NTBD, *NWID, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PRDDFN, *PRDLOD, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SRVPGM, *SSND, *TBL, *USRIDX, *USRQ, *USRSPC, *VLDL, *WSCST
NEWOBJ
New object
Specifies the new name for the object. The object stays in the same library. This is a required parameter.
ASPDEV
ASP device
Specifies the ASP device where storage is allocated for the library containing the object. Specify it when the library is in an ASP outside the thread's library name space.
Suggested / special values:
*, *CURASPGRP, *SYSBAS
*- Searches the ASPs currently in the thread's library name space: the system ASP (ASP 1), basic user ASPs (2-32), and the primary and secondary ASPs of the thread's ASP group if it has one.
*CURASPGRP- Searches only the primary and secondary ASPs of the thread's ASP group. An error is issued if the thread has no ASP group.
*SYSBAS- Searches the system ASP (ASP 1) and basic user ASPs (2-32) only, even if the thread has an ASP group.
SYSTEM
System
Specifies whether the rename is done on the local system or a remote system, when the object is a Distributed Data Management (DDM) file.
Allowed values:
*LCL, *RMT, *FILETYPE
*LCL- The file on the local system is renamed.
*RMT- The remote file referred to by the source DDM file is renamed.
*FILETYPE- If OBJ names a DDM file the rename is remote; if it does not, the rename is local.
Examples
RNMOBJ OBJ(PAYROLL/FILEX) OBJTYPE(*FILE) NEWOBJ(MSTR)
Searches library PAYROLL for file FILEX. If found and authority allows, renames FILEX to MSTR.
Generated from os/cl/catalog/RNMOBJ.json and os/cl/help/RNMOBJ.json.