Moves a file from one account to another, or a data section from one file to another, and optionally renames the file being moved.
TCL-1 command.
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-name}
file-name
TO: account-name
{new-file-name}
To move a data section from one file to another in the same or a different account, use:
MOVE-FILE {account-name}
file-name,data-section-name
TO:
account-name new-file-name{,new-data-section-name}
Note: Both forms provide the option of renaming the file being moved.
account-name are the names of the source and destination accounts, respectively.
file-name is any valid file-name on the named account or the currently logged on account.
data-section-name is 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-name is an optional new name for the file being moved.
new-data-section-name
is an optional new name for the data section being moved.
SYS2 privileges are required to execute MOVE-FILE.
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.
:
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.