MOVE-FILE

Moves a file from one account to another, or a data section from one file to another, and optionally renames the file being moved.

Command class

TCL-I command.

Syntax

Two forms can be used, as follows:

Note

Both forms provide the option of renaming the file being moved.

Syntax elements

account-name1, account-name2
are the names of the source and destination accounts, respectively.

file-nameis any valid file name on the named account or the currently logged on account.

data-section-nameis a data section associated with a name different from the dictionary. Must immediately follow file-name and must be preceded by a comma.

new-file-nameis an optional new name for the file being moved.

new-data-section-nameis an optional new name for the data section being moved.

Restrictions

SYS2 privileges are required to execute MOVE-FILE.

MOVE-FILE cannot move files larger than 2 GB in a filestore database. If this feature is required for large files a partition database must be used.

Comments

You can rename a file without moving it by specifying the same account name as the logged on account, but it is much easier to use the RENAME-FILE command.

To rename an account, use the first syntax form substituting SYSTEM  for the source and destination account names, and the old and new names of the account for file-name and new-file-name respectively. See Renaming Accounts.

Examples

:MOVE-FILE MY.FILE
TO:HIS.ACCOUNT HIS.FILE

A file called HIS.FILE is created on the HIS.ACCOUNT account with the same modulo as MY.FILE on the currently logged on account.  The dictionary and data sections of MY.FILE on the current account are copied to HIS.FILE on HIS.ACCOUNT.

:MOVE-FILE MASTER,SERVANT
TO:MAIN.ONE MASTER,SLAVE

Assuming that the current logged on account is MAIN.ONE, this example simply renames the data section called SERVANT to the data section called SLAVE.

Use of the RENAME-FILE command would be more efficient.

:MOVE-FILE SYSPROG DEVELOP,NEW.BASIC
TO:MY.ACCOUNT DBSOURCE,RELATE

Moves the data section named NEW.BASIC associated with the DICT file DEVELOP on the SYSPROG account to the MY.ACCOUNT account and places it in the DBSOURCE file and renames it RELATE.