CALL "CBL_RENAME_FILE" USING oldName newName GIVING returnCode |
oldName | PIC X(n) | Specifies the name of the file that you want to rename. If no path is given, then the current directory is assumed. 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. |
newName | PIC X(n) | Specifies the new name for the file. If no path is given, then the current directory is assumed. 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. |
0 | Operation successful. |
14605 | Not found. |
14613 | Is directory |
*> define curr-date as pic x(6) *> new-name and old-name as pic x(n) accept curr-date from date initialize new-name string "c:\app1\reps\cust-report-" curr-date ".lst" into new-name end-string move "c:\app1\reps\cust-report.lst" to old-name call "cbl_rename_file" using old-name new-name if return-code not = 0 display message "Rename operation failed" end-if |