The rename object API QLIRNMO
Ibm Says:
Ibm Says:
Required Parameter Group
From qualified object name
INPUT; CHAR(20)
The object being renamed and the library in which it is located.
The first 10 characters contain the object name, and the second
10 characters contain the library name. You can use these special
values for the library name:
*CURLIB
The job's current library
*LIBL
The job's library list
Object type
INPUT; CHAR(10)
The type of object being renamed. If the from object and the to
object belong to the same library, only a rename operation is done.
The object type must be supported on the RNMOBJ command. If the
from object and the to object belong to different libraries, a move
operation is done. The object type must be supported on the MOVOBJ
command. If both a rename and a move operation are done, the object
type must be supported on both the RNMOBJ and MOVOBJ commands.
An asterisk (*) must precede the object type. For a list of the
object types that cannot be moved or renamed, see the CL Programming
book.
To qualified object name
INPUT; CHAR(20)
The new name of the object and the new library in which it will be
located. The object name can be the same name as the original object
or a new name. The library name can be the same name as the original
library or a new name. If the object name is the same as the original
object, the library name must not be the same as the original library.
The first 10 characters contain the object name, and the second 10
characters contain the library name.
Replace object
INPUT; CHAR(1)
Whether to replace an existing object with the same name as the to object
and library name parameter. The following values can be specified:
0
Do not replace the existing object. If 0 is specified and the object already
exists, an error message is returned to the application.
1
Replace the existing object.
Error code
I/O; CHAR(*)
From qualified object name
INPUT; CHAR(20)
The object being renamed and the library in which it is located.
The first 10 characters contain the object name, and the second
10 characters contain the library name. You can use these special
values for the library name:
*CURLIB
The job's current library
*LIBL
The job's library list
Object type
INPUT; CHAR(10)
The type of object being renamed. If the from object and the to
object belong to the same library, only a rename operation is done.
The object type must be supported on the RNMOBJ command. If the
from object and the to object belong to different libraries, a move
operation is done. The object type must be supported on the MOVOBJ
command. If both a rename and a move operation are done, the object
type must be supported on both the RNMOBJ and MOVOBJ commands.
An asterisk (*) must precede the object type. For a list of the
object types that cannot be moved or renamed, see the CL Programming
book.
To qualified object name
INPUT; CHAR(20)
The new name of the object and the new library in which it will be
located. The object name can be the same name as the original object
or a new name. The library name can be the same name as the original
library or a new name. If the object name is the same as the original
object, the library name must not be the same as the original library.
The first 10 characters contain the object name, and the second 10
characters contain the library name.
Replace object
INPUT; CHAR(1)
Whether to replace an existing object with the same name as the to object
and library name parameter. The following values can be specified:
0
Do not replace the existing object. If 0 is specified and the object already
exists, an error message is returned to the application.
1
Replace the existing object.
Error code
I/O; CHAR(*)
PHP Code:
The API
* PROGRAM - @RENAME
* PURPOSE - rename object use API QLIRNMO
* WRITTEN -
* AUTHOR -
* PROGRAM DESCRIPTION
*--------------------------------------------------------
*
* Entry Plist
*
d @RENAME pr
d OldFile 10
d OldLib 10
d NewFile 10
d NewLib 10
d inType 10
*
d @RENAME pi
d OldFile 10
d OldLib 10
d NewFile 10
d NewLib 10
d inType 10
*
* Variable Definition
*
d Error s 34
d FromObject s 20
d ObjectType s 10
d ToObject s 20
d Replace s 1
*
* Program Info
*
d SDS
d @PGM 001 010
d @PARMS 037 039 0
d @MSGDTA 91 170
d @MSGID 171 174
d @JOB 244 253
d @USER 254 263
d @JOB# 264 269 0
//
// external calls
//
d $Rename pr extpgm('QLIRNMO')
d fromObject 20
d ObjectType 10
d ToObject 20
d Replace 1
d Error 34
/Free
//--------------------------------------------------------
// MAIN LINE
//--------------------------------------------------------
// take parms and rename --and/or-- move object
FromObject = OldFile + OldLib;
ToObject = NewFile + NewLib;
ObjectType = InType;
replace = '1';
$rename(FromObject : ObjectType : ToObject : Replace : Error);
*inlr = *on;
//--------------------------------------------------------
// *Inzsr - one time run subroutine
//--------------------------------------------------------
begsr *inzsr;
endsr;
/End-Free
Comment