File Utility Program (FUP) Management Programming Manual

Management Application Example
File Utility Program (FUP) Management Programming Manual523322-001
A-4
ENTER TAL "FNAMEEXPAND" USING USER-TYPED-FILENAME
SOURCE-FILE
DEFAULT-VOL
GIVING LEN.
IF LEN = 0 DISPLAY "Invalid file name. Try again."
GO TO P100.
*=========================================================
* Ask the user for the destination file name and convert
* the name to internal format.
P200.
DISPLAY "Enter the destination file name:".
ACCEPT USER-TYPED-FILENAME.
ENTER TAL "SHIFTSTRING" USING USER-TYPED-FILENAME, 35, 0.
ENTER TAL "FNAMEEXPAND" USING USER-TYPED-FILENAME
DEST-FILE
DEFAULT-VOL
GIVING LEN.
IF LEN = 0 DISPLAY "Invalid file name. Try again."
GO TO P200.
*=========================================================
* Get the FUP options for the DUPLICATE command.
* First, call the SSNULL procedure to initialize
* the options structure to null values.
ENTER TAL "SSNULL"
USING ZFUP-MAP-PAR-DUP, ZFUP-DDL-PAR-DUP
GIVING ERR.
IF ERR NOT = 0 DISPLAY "SSNULL error: " ERR
DISPLAY "Operation terminated."
GO TO P700.
P300.
DISPLAY "Do you want to preserve the file timestamp?".
ACCEPT Y-OR-N.
ENTER TAL "SHIFTSTRING" USING Y-OR-N, 1, 0.
EVALUATE Y-OR-N
WHEN "Y" MOVE COBOL-VAL-TRUE
TO ZPRESERVE-TIMESTAMP OF ZFUP-DDL-PAR-DUP
WHEN "N" MOVE COBOL-VAL-FALSE
TO ZPRESERVE-TIMESTAMP OF ZFUP-DDL-PAR-DUP
WHEN " " CONTINUE
WHEN OTHER DISPLAY "Enter Y or N (or blank for N)."
GO TO P300
END-EVALUATE.
Figure A-1. Management Application Example (page 4 of 8)