Trailing-Edge
-
PDP-10 Archives
-
decuslib20-07
-
decus/20-0168/fmtver.cbl
There is 1 other file named fmtver.cbl in the archive. Click here to see a list.
IDENTIFICATION DIVISION.
PROGRAM-ID. FMTVER.
AUTHOR. BOB CONLON.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FORMAT-FILE ASSIGN TO DSK.
DATA DIVISION.
FILE SECTION.
FD FORMAT-FILE; VALUE OF IDENTIFICATION IS FORMAT-NAME.
01 FORMAT-REC; PIC X(4035).
WORKING-STORAGE SECTION.
77 NUM-HOLD PIC 9(3); VALUE 0.
01 FORMAT-HOLD.
02 FILLER PIC X(3723).
02 VERSION-NUMBER PIC 9(3).
02 FILLER PIC X(309).
01 FORMAT-NAME.
02 FN PIC X(6).
02 FILLER PIC X(3); VALUE "FMT".
PROCEDURE DIVISION.
OPENING SECTION.
OPENERS.
DISPLAY "FORMAT NAME: "; WITH NO ADVANCING.
ACCEPT FN.
OPEN INPUT FORMAT-FILE.
READ FORMAT-FILE; AT END GO TO ALL-DONE.
MOVE FORMAT-REC TO FORMAT-HOLD.
CLOSE FORMAT-FILE.
DISPLAY "VERSION NUMBER IS " VERSION-NUMBER.
DISPLAY " ".
DISPLAY "ENTER NEW NUMBER: "; WITH NO ADVANCING.
ACCEPT NUM-HOLD.
IF NUM-HOLD = 0 GO TO ALL-DONE.
OPEN OUTPUT FORMAT-FILE.
MOVE NUM-HOLD TO VERSION-NUMBER.
MOVE FORMAT-HOLD TO FORMAT-REC.
WRITE FORMAT-REC.
ALL-DONE.
STOP RUN.