Function
Renames a file or a magnetic tape.
Format
RENAME name,general local name
Forbidden contexts
NO USER
Execution
Files
The general local name of the specified file is changed to the form specified by the second parameter, provided that the file is a terminal file belonging to the proper user and it has a ERASE trap set for him. The command may be used to change a complete name or simply some part of a name, such as the language code or generation number.
Since dumps of the file are recognised by name, any existing dump is lost, so the file is marked as needing to be dumped.
Secure Tapes
The source tape specified by the first parameter has its header label alterered to hold the name and details specified by the second parameter and the filestore records for this tape are updated. This is only done if there is a erase trap set for the proper user and the directory does not hold a file with the general local name specified in the second parameter. Information held on the tape is lost when the header label is rewritten.
If the tape is a named worktape and the second parameter of the RENAME command is a worktapename, then the worktape name in the directory is updated. If the tape is a worktape obtained in the normal way, it will not already have a worktape name. In this case the RENAME command will give it the worktape name specified in the second parameter. This converts it to a named work tape.
The RENAME command, then, may be used to alter the name on a worktape's header label or to give a new worktape name (a reference name intended to make it easier to refer to worktapes in job descriptions). In the latter case, the second parameter to the RENAME command begins with !.
Insecure Tapes
The insecure tape specified by the first parameter has its header label alterered to hold the name and details specified by the second parameter. Information held on the tape is lost when the header label is rewritten.
Example
RENAME MYFILE(3/OUT),MYFILE(3/IN)
RENAME :Z.CARDDATA,CD
RENAME FREETAPE(*MT),OTTOSTAPE
RENAME SPUD(*MT),!FRED
Error Messages
z IS NOT A TERMINAL FILE
z ALREADY EXISTS
GENERAL LOCAL NAME IS ALREADY IN USE AS A FILENAME
DEVICE QUALIFIER IMPERMISSIBLE
ALTERING DIRECTORY ENTRIES REQUIRES OWNERSHIP
MAGNETIC TAPE FAILED
z IS A NAMED WORK TAPE
NAMED WORK TAPE z IS ALREADY ONLINE