RENAME renames the file specified by SOURCE-FILE to the name specified by DEST-FILE. The syntax of RENAME is:
CALL "RENAME" USING SOURCE-FILE, DEST-FILE, RENAME-STATUS, FILE-TYPE.
Remote file name notation is not permitted on the DEST-FILE parameter. If the SOURCE-FILE parameter specifies a remote file:
Parameters that do not specify an absolute pathname (an absolute path starts with a "/"), are considered to be located relative to the directory in which the server (acuserve) was started. For example:
If acuserve was started on condor in the /acucobol directory, and SOURCE-FILE is:
AcuServer expects to find index.dat in directory /acucobol/sales_records (note the absence of a "/" after condor:).
If SOURCE-FILE is:
AcuServer expects to find index.dat in directory /usr2/sales_records.
These pathing rules hold for both SOURCE-FILE and DEST-FILE; however, DEST-FILE can never include the name of the remote host (@condor).
FILE_PREFIX is not used to search for file names held in any of the function's parameters. Name aliases are not substituted for names held in the function's parameters. Full path names to the files, including remote name notation on the SOURCE-FILE, must be hard coded in the function call. A more portable solution is to use the ACCEPT FROM ENVIRONMENT statement to get pathnames during program execution. See ACCEPT Statement in the ACUCOBOL-GT Reference Manual for more information.
RENAME-STATUS holds a zero (0) if the routine is successful; otherwise, it is set to the operating system's error number, or 19 if there is a network error (for example, AcuServer is not running).
For a complete description of RENAME, excluding the above restrictions, see Appendix I of the ACUCOBOL-GT documentation.