File Utility Program (FUP) Management Programming Manual

FUP Commands and Responses
File Utility Program (FUP) Management Programming Manual523322-001
3-19
DUPLICATE Command
If an application specifies an existing file for the restart file, or if the ZZRSTART file
already exists (and ZFUP-TKN-RESTART-FILE contains all blanks), FUP returns
the error ZFUP-ERR-FILESYS. This error indicates that a file-system error
occurred. The response buffer contains a second error list indicating file-system
error 10 (file already exists).
Example
Figure 3-2 shows a TAL example of a high-level procedure for the DUPLICATE
command:
Figure 3-2. TAL Example of a DUPLICATE Procedure (page 1 of 3)
!----------------------------------------------------------
! DUP is an example of a high-level procedure for the FUP
! DUPLICATE command. This procedure demonstrates the use
! of the programmatic FUP interface with a file-name tem-
! plate and with ZSPI^TKN^MAXRESP, ZSPI^TKN^RESPONSE^TYPE,
! and ZSPI^TKN^ALLOW^TYPE defaulted. FUP returns a re-
! sponse for each file in file set and one response per
! buffer.
!
! This procedure assumes that the FUP process is already
! running. If FUP returns an error, the procedure prints
! an error message and returns.
!
! This procedure returns 0 if there are no errors or
! an error number if an error prevented the full file
! set from being processed.
!----------------------------------------------------------
INT PROC DUP (sourcefile, destfile, numberduped, partonly,
preserve^timestamp, preserve^owner,
preserve^security, destoption) VARIABLE;
! Parameter Declarations
INT .sourcefile; ! Source file(s) to duplicate
INT .destfile; ! Destination
INT(32) .numberduped; ! Number of files duplicated
INT partonly; ! True only if primary
! partition
INT preserve^timestamp; ! Save timestamp (Boolean)
INT preserve^owner; ! Save ownership (Boolean)
INT preserve^security; ! Save security (Boolean)
INT destoption; ! Disposition of destination