FCOPY/'source filespec','destination filespec'[,IFERR,label:]
Creates a new file which is a copy of an existing file. The copy may be renamed by specifying a different filespec in the destination filespec.
Parameter |
Description |
'source filespec' |
The filespec of the file to be copied. The filespec is the pathname plus the filename you want. If the file you need is in your current directory, the filename will be sufficient to find it. Copying a file from one directory to another requires that the file extension (e.g. .PRT, or .GRS) be specified. |
'destination filespec' |
The filespec of the file to be created. |
IFERR,label: |
Specifies a label to which the program jumps if an error occurs. |
This example demonstrates copying a file from the user's current directory to another directory, and copying a file from a directory which is not the current directory into another directory.
Current Directory
FCOPY/'PROGRAM.GRS',':GRIP:SUBGRIP:PROGRAM.GRS,$
IFERR',L10:
Not Current Directory
FCOPY/':SUBGRIP:PROGRAM.GRS',':SUB1:PROGRAM.GRS',$
IFERR,L10:
Error Message
L10:MESSG/'CANNOT COPY PROGRAM'