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:
-
To move an entire file (DICT and associated data sections) from one account to another, use:
MOVE-FILE {account-name1} file-name
TO: account-name2 {new-file-name} -
To move a data section from one file to another in the same or a different account, use:
MOVE-FILE {account-name1} file-name,data-section-name
TO: account-name2 new-file-name{,new-data-section-name}
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.FILETO:
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,SERVANTTO:
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.BASICTO:
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.