-
Notifications
You must be signed in to change notification settings - Fork 0
/
STUDENT-LIST.cbl
87 lines (73 loc) · 3.06 KB
/
STUDENT-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
82
83
84
85
86
87
******************************************************************
*PROGRAM : STU-LIST *
*AUTHOR : MONTANA RUTH *
*DATE : Mar 17, 2015 *
*ABSTRACT: *
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. STU-LIST.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT STU-MST ASSIGN TO'../FILES/STUDENT-MASTER.DAT'
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY IS STU-ID
ALTERNATE KEY IS STU-NAME
WITH DUPLICATES.
DATA DIVISION.
FILE SECTION.
COPY STU-MST-DEF.
WORKING-STORAGE SECTION.
COPY WS-DATE-TIME.
01 WS-CTR PIC 99 VALUE 0.
01 WS-RESP PIC X.
01 WS-EOF PIC X VALUE 'N'.
88 EOF VALUE 'Y'.
SCREEN SECTION.
COPY SCR-HEADER.
01 HEADER-2.
03 LINE 03 COL 37 VALUE 'STUDENT LISTING'.
03 LINE 05 COL 01 VALUE 'ID'.
03 COL 06 VALUE 'LAST NAME'.
03 COL 22 VALUE 'FIRST NAME'.
03 COL 38 VALUE 'STREET'.
03 COL 64 VALUE 'ZIP'.
03 COL 70 value 'PHONE'.
PROCEDURE DIVISION.
000-MAIN.
OPEN INPUT STU-MST.
MOVE 'N' TO WS-EOF.
MOVE 0 TO WS-CTR.
PERFORM 999-DISP-HEADERS.
DISPLAY SPACES.
DISPLAY SPACES.
PERFORM UNTIL EOF
READ STU-MST
AT END
MOVE 'Y' TO WS-EOF
NOT AT END
PERFORM 100-DISPLAY
END-READ
END-PERFORM.
CLOSE STU-MST.
DISPLAY "PRESS ENTER TO EXIT" WITH NO ADVANCING.
ACCEPT WS-RESP.
EXIT PROGRAM.
100-DISPLAY.
ADD 1 TO WS-CTR.
IF WS-CTR > 15 THEN
DISPLAY SPACES
DISPLAY 'PRESS ENTER TO CONTINUE'
ACCEPT WS-RESP
PERFORM 999-DISP-HEADERS
DISPLAY SPACES
DISPLAY SPACES
MOVE 1 TO WS-CTR
END-IF.
DISPLAY STU-ID, " ", STU-L-NAME, " ", STU-F-NAME," ",
STU-STREET, " ", STU-ZIP, " ", STU-PHONE.
999-DISP-HEADERS.
ACCEPT WS-DATE FROM DATE.
ACCEPT WS-TIME FROM TIME.
DISPLAY HEADER, HEADER-2.