File Utility Program (FUP) Management Programming Manual
Management Application Example
File Utility Program (FUP) Management Programming Manual—523322-001
A-3
*=========================================================
* Form the name to open FUP for SPI commands and assign
* it to the #DYNAMIC file.
STRING FUP-PROCESS-NAME ".#ZSPI" DELIMITED BY " "
INTO FUP-SPI-NAME.
ENTER "COBOLASSIGN" USING FUP-FILE FUP-SPI-NAME
GIVING ERR.
IF ERR NOT = 0 DISPLAY "COBOLASSIGN error: " ERR
DISPLAY "Operation terminated."
STOP RUN.
*=========================================================
* Open the FUP server.
OPEN I-O FUP-FILE.
*=========================================================
* Get the default volume and subvolume from the startup
* message. Convert them into internal format by
* appending a file name and then calling FNAMEEXPAND.
ENTER "GETSTARTUPTEXT" USING VOLUME-PORTION
EXTERNAL-DEFAULT-VOL
GIVING ERR.
IF ERR < 0 DISPLAY "GETSTARTUPTEXT error: " ERR
DISPLAY "Operation terminated."
STOP RUN.
STRING EXTERNAL-DEFAULT-VOL ".X" DELIMITED BY " "
INTO TEMP.
ENTER TAL "FNAMEEXPAND" USING TEMP
DEFAULT-VOL
JUNK
GIVING LEN.
IF LEN = 0 DISPLAY "FNAMEEXPAND error occurred."
DISPLAY "Operation terminated."
STOP RUN.
*=========================================================
* Ask the user for the source file name, or Q[UIT] to
* stop. Convert the name to the internal format.
P100.
DISPLAY "FUP DUPLICATE Program".
DISPLAY "Enter the source file name (or QUIT to stop):".
ACCEPT USER-TYPED-FILENAME.
enter tal "debug".
ENTER TAL "SHIFTSTRING"
USING USER-TYPED-FILENAME, 35, 0.
EVALUATE USER-TYPED-FILENAME
WHEN "QUIT" DISPLAY "Good-bye."
CLOSE FUP-FILE
STOP RUN
WHEN "Q" DISPLAY "Good-bye."
CLOSE FUP-FILE
STOP RUN
END-EVALUATE.
Figure A-1. Management Application Example (page 3 of 8)