Function
Makes a copy of an existing terminal file, by setting up a new file or overwriting an old one.
Format
COPY file description,file description
The first parameter is the name of the file to be copied, the second
is that of the file to be created or overwritten.
The file description of the file to be created or overwritten may
contain the TRAPGO qualifier.
Forbidden contexts
NO USER
Execution
A check is made that the user has READ access to the file that is
copied and that, if the second parameter does not refer to an existing
file, he will own the file created. If either of these requirements is
not satisfied, the command is abandoned. If the second file name is
already in use, the usual conventions apply with regard to overwriting
the contents of the file unless the APPEND qualifier is given. In this
case the first file will be appended to the end of the second file
under certain conditions. If the two parameters identify the same file,
the following message will be semt to the monitoring file system
(COMMENT category):
YOU HAVE COPIED z TO ITSELF
This message is also sent if an APPEND qualifier was given to the second parameter; the command would still have no effect.
The new file will have the same retention period and record information as the file that has been copied. The traps are the standard initial traps unless the copy overwrites an existing file, or the TRAPGO qualifier has been used to set other traps. If the MULTIPLE qualifier is given to the second file name, a multifile will be set up irrespective of whether the first parameter is the name of a multifile. If the first file is a multifile the second file name must have the MULTIPLE qualifier.
Break-in while copying to a multifile will cause the copying to be abandoned and the state of the output file will be indeterminate.
Example
COPY :FRED(3/DISC),MYFILE
Error Messages
z IS NOT A TERMINAL FILE