8 File Storage
COPY source file spec TO destination file spec
Execution of the COPY statement causes all records of a DATA file to be copied. A check of the name of the destination is made; an error is given if the name is already present. If not, a file of the same characteristics as the source file is created. The same directory can be both source and destination.
For example, this statement copies a file named DATA1 from the current volume to a new file named DATA2 on a volume labeled BACKUP:
160 COPY "DATA1" TO "DATA2,BACKUP"The contents of a spool file, a file created by a previous printer assignment statement, are dumped to an output device, such as the display or a printer, by specifying only the source file spec in a COPY statement:
COPY source file spec
Use of spool files is covered in page 249 .