ContentsIndexPreviousNext

C$COPY Routine

C$COPY creates a copy of an existing file.

Usage

CALL "C$COPY"
    USING SOURCE-FILE, DEST-FILE, FILE-TYPE,
    GIVING COPY-STATUS

Parameters

SOURCE-FILE PIC X(n)

Contains the name of the file to copy. Remote name notation is allowed for this parameter.

DEST-FILE PIC X(n)

Contains the destination file name. Remote name notation is allowed for this parameter.

FILE-TYPE (optional) PIC X

Indicates the file type. If the FILE-TYPE parameter is supplied, it must be either "S", "R", or "I" indicating that the source file is a sequential, relative, or indexed file. This can be useful in cases where the original file is held in more than one physical disk file (for example, C-ISAM indexed files are physically held in two separate files). If the FILE-TYPE parameter is omitted, then only the single physical file named in SOURCE-FILE is copied.

COPY-STATUS Any numeric type

Returns zero if successful, or non-zero if not. Currently, an unsuccessful status code is always "1", but future versions may return additional information.

C$COPY creates an exact duplicate of SOURCE-FILE in DEST-FILE.


Note: The behavior of this library routine is affected by the setting of the FILENAME-SPACES configuration variable. See the documentation in Appendix H, Configuration File Entries, for information about the terminating character for path names.