ContentsIndexPreviousNext

9.3.3 RENAME

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:

If acuserve was started on condor in the /acucobol directory, and SOURCE-FILE is:

@condor:sales_records/index.dat

AcuServer expects to find index.dat in directory /acucobol/sales_records (note the absence of a "/" after "condor:").

If SOURCE-FILE is:

@condor:/usr2/sales_records/index.dat

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 Appendix H of the ACUCOBOL-GT documentation.

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.