File Utility Program (FUP) Management Programming Manual

Management Application Example
File Utility Program (FUP) Management Programming Manual523322-001
A-7
*=========================================================
* Get the return code token. Specify an index of 1 in
* the SSGET call so that the order of tokens in the
* buffer doesn’t matter.
ENTER TAL “SSGET” USING ZFUP-DDL-MSG-BUFFER
ZSPI-TKN-RETCODE
RETCODE
1
GIVING ERR.
IF ERR NOT = 0
DISPLAY “SSGET error on ZSPI-TKN-RETCODE: “ ERR
DISPLAY “Operation terminated.”
GO TO P700.
IF RETCODE NOT = 0
EVALUATE RETCODE
WHEN ZFUP-ERR-FILESYS PERFORM DISPLAY-FILESYS-ERROR
WHEN OTHER
DISPLAY “DUP failed; ZSPI-TKN-RETCODE: “ RETCODE
END-EVALUATE
DISPLAY “Operation terminated.”
GO TO P700.
*=========================================================
* Display the successful DUP message.
DISPLAY "DUP was successful!".
DISPLAY " ".
MOVE SPACES TO IN-EXTERNAL-NAME.
ENTER TAL "FNAMECOLLAPSE" USING SOURCE-FILE
IN-EXTERNAL-NAME.
MOVE SPACES TO OUT-EXTERNAL-NAME.
ENTER TAL "FNAMECOLLAPSE" USING DEST-FILE
OUT-EXTERNAL-NAME.
DISPLAY
IN-EXTERNAL-NAME " duplicated to " OUT-EXTERNAL-NAME.
*=========================================================
* Determine if the user wants to dup another file.
P700.
DISPLAY " ".
DISPLAY "Do you want to DUP another file (Y or N)?".
ACCEPT Y-OR-N.
ENTER TAL "SHIFTSTRING" USING Y-OR-N, 1, 0.
EVALUATE Y-OR-N
WHEN "Y" GO TO P100
WHEN "N" DISPLAY "Good-bye."
CLOSE FUP-FILE
STOP RUN
WHEN OTHER DISPLAY "Please enter Y or N."
GO TO P700
END-EVALUATE.
*=========================================================
* DISPLAY-FILESYS-ERROR routine - Enters the FUP error
* list and then enters the nested file-system error list.
* From the file-system error list, gets the ZSPI-TKN-ERROR
Figure A-1. Management Application Example (page 7 of 8)