skip to main content

Library Routines : C$COPY

C$COPY
The C$COPY library routine copies a file to a destination.
FILE-PREFIX settings are ignored by this routine.
Syntax:
 CALL "C$COPY" USING sourceFile 
Parameters:
Return code:
returnCode can be any numeric data item and provides additional information:
Examples:
Example - Copy file from server to client when running in thin-client mode and backup report on server only
working-storage section.
77 sourceFile pic x(256).
77 destFile   pic x(256).
77 retCode    pic s9(9).
procedure division.
   move "/myapp/reports/custlist.txt" to sourceFile
   move "@[DISPLAY]:c:\tmp\reports\custlist.txt" to destFile
   call "c$copy" using sourceFile destFile
          giving retCode.
   if retCode not = 0
      display message "Copy failed with error : " retCode
   else
      display message "File was copied"
   end-if.
   move "/myapp/reports/custlist.txt" to sourceFile
   move "/myapp/backups/reports/custlist.txt" to destFile
   call "c$copy" using sourceFile destFile
          giving retCode.
   if retCode not = 0
      display message "Backup failed with error : " retCode
   else
      display message "File was backed up"
   end-if.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left