Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Move Object (MOV) command moves an object from the directory it is in to a different directory.
If the To directory (TODIR) parameter is used, the object is moved to another directory and the object keeps the same name. If the To object (TOOBJ) parameter is used the object is also renamed.
If the original object is a read-only file (a file that has the PC read-only attribute flag turned on), the move command operates as follows:
When moving a file within a file system, the Last access date/time, the Data change date/time and the Attribute change date/time are preserved in the new file. If the file is moved outside of the original file system to the "root" (/), QOpenSys, QDLS, or UDFS file systems, the Attribute change date/time is changed to the current time. In the case of moving to a database file member (*MBR) in the QSYS.LIB or independent ASP QSYS.LIB file system, the Data change date/time is updated as well.
This command can also be issued using the following alternative command name:
For more information about integrated file system commands, see the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Restrictions:
Note: The authority requirements for this command are complex with respect to file systems, object types, requested operations etc.. Therefore, see the iSeries Security Reference, SC41-5302 book for information about the required authorities for this command.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
OBJ | Object | Path name | Required, Positional 1 |
TODIR | To directory | Path name, '.' | Optional, Positional 2 |
TOOBJ | To object | Path name | Optional |
FROMCCSID | From CCSID | 1-65533, *OBJ, *PCASCII, *JOBCCSID | Optional |
TOCCSID | To CCSID | 1-65533, *OBJ, *CALC, *STDASCII, *PCASCII, *JOBCCSID | Optional |
DTAFMT | Data Format | *BINARY, *TEXT | Optional |
FROMCODPAG | From Code Page | 1-32767, *OBJ, *PCASCII | Optional |
TOCODEPAGE | To Code Page | 1-32767, *OBJ, *CALC, *STDASCII, *PCASCII | Optional |
Top |
Specifies the path name of the object or objects to be moved.
The object path name can be either a simple name or a name that is qualified with the name of the directory in which the object is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Note: An object name pattern can only be used when the To directory (TODIR) parameter is used.
Top |
Specifies the path name of the directory to which the object is to be moved. The moved object uses the name supplied on the Object (OBJ) parameter.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Note: The TODIR and To object (TOOBJ) parameters are mutually exclusive.
Top |
Specifies the path name of the directory the object is to be moved to and the new name of the object.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Note: The To directory (TODIR) and TOOBJ parameters are mutually exclusive.
Top |
Specifies the method for obtaining the coded character set identifier (CCSID) for the source of the move operation. This CCSID will be used for data conversion, if requested. This parameter is ignored if the object specified on the Object (OBJ) parameter is not a regular file. A regular file is a file that supports the integrated file system input/output (I/O) operations open, read, and write.
Top |
Specifies the data coded character set identifier (CCSID) for the target of the move operation. This parameter is ignored if the object specified on the Object (OBJ) parameter is not a regular file. A regular file is a file that supports the integrated file system input/output (I/O) operations open, read, and write.
Top |
Specifies the format of the data in the file to be moved.
If a database member is to be moved to a stream file, any line-formatting characters (such as carriage return, tab, and end-of-file) are just converted from one CCSID to another.
If a stream file is to be moved to a database member, the stream file must contain end-of-line characters or the move will fail. If the stream file does contain end-of-line characters, the following actions are performed during the move to a database file.
Top |
Specifies the method for obtaining the code page for source of the move operation. This code page will be used for data conversion, if requested. This parameter is ignored if the object specified on the Object (OBJ) parameter is not a regular file. A regular file is a file that supports the integrated file system input/output (I/O) operations open, read, and write.
Note: This parameter is replaced by the From CCSID (FROMCCSID) parameter, but the FROMCODPAG parameter can still be used. However, because this parameter may be removed in a later release, whenever possible use the FROMCCSID parameter.
Top |
Specifies the data code page for the target of the move operation. This parameter is ignored if the object specified on the Object (OBJ) parameter is not a regular file. A regular file is a file that supports the integrated file system input/output (I/O) operations open, read, and write.
Note: This parameter is replaced by To CCSID (TOCCSID), but the TOCODEPAGE parameter can still be used. However, because this parameter may be removed in a later release, whenever possible use the TOCCSID parameter.
Top |
Example 1: Moving an Object
MOV OBJ('/CURRENT/DECEMBER-1994-MONTHLY-PAYROLL-FILE') TODIR('/ARCHIVE')
This command moves a file named DECEMBER-1994-MONTHLY-PAYROLL-FILE from a directory named CURRENT to a directory named ARCHIVE.
Example 2: Moving with Conversion
MOV OBJ('/DATAFB') TOOBJ('/QSYS.LIB/APP1.LIB/DATA.FILE/DATAFB.MBR') TOCODEPAGE(*CALC) DTAFMT(*TEXT) TOCCSID(*CALC)
The stream file 'DATAFB' is to be moved to the database file 'DATAFB.MBR'. By specifying TOCCSID(*CALC), the file system being moved to (the QSYS.LIB file system in this case) will try to create the new member in the same CCSID as '/DATAFB'. If this fails (in this case, if 'DATA.FILE is not in the same CCSID as 'DATAFB'), the file system will be allowed to choose an appropriate CCSID and complete the move. By specifying DTAFMT(*TEXT), the data in 'DATAFB' is handled as text and is converted into the CCSID chosen for the new file 'DATAFB.MBR'.
Top |
*ESCAPE Messages
Top |