-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILDING-LIST.cbl
81 lines (80 loc) · 3.43 KB
/
BUILDING-LIST.cbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
IDENTIFICATION DIVISION.
PROGRAM-ID. BUILDING-LIST.
*-----------------------------------------------------------------
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT BLD-MASTER ASSIGN TO
'../FILES/BUILDING-MASTER.DAT'
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY IS BLD-BUILDING-ROOM
FILE STATUS IS WS-STAT.
*-----------------------------------------------------------------
DATA DIVISION.
*-----------------------------------------------------------------
FILE SECTION.
FD BLD-MASTER.
01 BLD-REC.
03 BLD-BUILDING-ROOM PIC X(12).
03 BLD-MAX-SEAT PIC 99.
WORKING-STORAGE SECTION.
COPY WS-COMMON.
01 WS-PG-BREAK.
03 FILLER PIC X(15) VALUE 'PRESS ENTER TO '.
03 FILLER PIC X(13) VALUE 'DISPLAY MORE '.
03 FILLER PIC X(47) VALUE 'RECORDS'.
01 WS-HEADER.
03 FILLER PIC X(15) VALUE 'BUILDING-ROOM'.
03 FILLER PIC X(65) VALUE 'MAX SEATS'.
01 WS-DTL-LN.
03 WS-BLD-ROOM PIC X(12).
03 FILLER PIC X(3) VALUE SPACES.
03 WS-MAX-SEAT PIC Z9.
*-----------------------------------------------------------------
SCREEN SECTION.
COPY SCR-COMMON.
01 SCR-TITLE.
03 LINE 03 COL 37 VALUE 'LIST BUILDINGS'.
*-----------------------------------------------------------------
PROCEDURE DIVISION.
000-MAIN.
OPEN INPUT BLD-MASTER.
ACCEPT WS-DATE FROM DATE.
ACCEPT WS-TIME FROM TIME
DISPLAY HEADER.
DISPLAY SCR-TITLE.
MOVE 'N' TO WS-EOF.
MOVE 0 TO WS-COUNTER.
DISPLAY WS-BLNK-LN.
DISPLAY WS-HEADER.
DISPLAY WS-BLNK-LN.
PERFORM UNTIL EOF
READ BLD-MASTER
AT END
MOVE 'Y' TO WS-EOF
NOT AT END
MOVE BLD-BUILDING-ROOM TO WS-BLD-ROOM
MOVE BLD-MAX-SEAT TO WS-MAX-SEAT
DISPLAY WS-DTL-LN
ADD 1 TO WS-COUNTER
IF WS-COUNTER = 15
THEN
DISPLAY WS-BLNK-LN
DISPLAY WS-PG-BREAK
ACCEPT WS-RESP
ACCEPT WS-DATE FROM DATE
ACCEPT WS-TIME FROM TIME
DISPLAY HEADER
DISPLAY SCR-TITLE
DISPLAY WS-BLNK-LN
DISPLAY WS-HEADER
DISPLAY WS-BLNK-LN
MOVE 0 TO WS-COUNTER
END-IF
END-READ
END-PERFORM.
DISPLAY 'PRESS ENTER TO GO BACK TO MENU'
ACCEPT WS-RESP.
CLOSE BLD-MASTER.
EXIT PROGRAM.