Creates a copy of an existing file.
Syntax:
CALL "C$COPY"
USING source-file, dest-file, [file-type,]
[GIVING status]
Parameters:
- source-file
- PIC X(n)
- dest-file
- PIC X(n)
- file-type
- PIC X
- status
- Any numeric type
On Entry:
- source-file
- The path name of the file to be copied
- dest-file
- The path name of the destination file
- file-type
- The file organization of the source file.It must be one of:
S (for sequential),
R (for relative) or
I (for indexed).
This defaults to S if not specified.
On Exit:
- copy-status
- Returns zero if the copy is successful, or non-zero if not.
Comments:
To obtain an extended file status code for this operation, define
status as
comp xx comp-x and follow the example in
Extended File Status Codes.