CALL "CBL_COPY_FILE" USING sourceFile destFile [flagPreserve] GIVING returnCode |
sourceFile | PIC X(n) | Specifies the filename to be copied. The name can be partially or entirely changed through configuration properties if iscobol.file.env_naming (boolean) is set to true. If the name is a relative path and iscobol.file.prefix is set, then the first FILE-PREFIX path is used to locate the file. The ISF protocol is not supported, it will invalidate the file path, if used. |
destFile | PIC X(n) | Specifies the destination filename. The name can be partially or entirely changed through configuration properties if iscobol.file.env_naming (boolean) is set to true. If the name is a relative path and iscobol.file.prefix is set, then the first FILE-PREFIX path is used to locate the file. The ISF protocol is not supported, it will invalidate the file path, if used. |
flagPreserve | PIC 9 | Optional parameter. If set to "1" applies the source file last modification date and time to the destination file. If set to "0" or omitted, the destination file is created with the current date and time. |
0 | Operation successful. |
14605 | Not found. |
14613 | Is directory. |
*> Define src-file and dest-file as pic x(n) move "c:\app1\reports\repcustomers.lst" to src-file move "c:\users\adam\reports\repcustomers.lst" to dest-file call "cbl_copy_file" using src-file dest-file if return-code not = 0 display message "Copy failed" end-if |