-
Notifications
You must be signed in to change notification settings - Fork 9
/
offer10b.mlc
241 lines (240 loc) · 9.67 KB
/
offer10b.mlc
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
PRINT NOGEN
****************************************************************
* FILENAME: OFFER10B.MLC *
* AUTHOR : Bill Qualls/z390 Adaption by Anthony Delosa *
* SYSTEM : z390 v1703 *
* REMARKS : Produce list of course offerings for all *
* semesters. Includes page break logic. *
****************************************************************
START 0
YREGS
BEGIN SUBENTRY
WTO 'OFFER10B ... Begin execution'
BAL R10,SETUP
MAIN EQU *
CLI EOFSW,C'Y'
BE EOJ
BAL R10,PROCESS
B MAIN
EOJ EQU *
BAL R10,WRAPUP
WTO 'OFFER10B ... Normal end of program'
RETURN
****************************************************************
* SETUP - Those things which happen one time only, *
* before any records are processed. *
****************************************************************
SETUP EQU *
ST R10,SVSETUP
OPEN (OFFER,INPUT)
OPEN (REPORT,OUTPUT)
BAL R10,READ
MVC HOLDSEM,ISEM
L R10,SVSETUP
BR R10
****************************************************************
* HDGS - Print headings. *
****************************************************************
HDGS EQU *
ST R10,SVHDGS
AP PGS,=P'1' Add 1 to page count
MVC HDPGS,=X'40202120' Edit pattern for page count
ED HDPGS,PGS Move page count to heading
MVC HDSEM,HOLDSEM Move semester
PUT REPORT,FORMFEED
PUT REPORT,HD1
PUT REPORT,HD2
PUT REPORT,BLANKS
PUT REPORT,HD3
PUT REPORT,HD4
ZAP LNS,=P'0' Reset line count to zero
L R10,SVHDGS
BR R10
****************************************************************
* PROCESS - Those things which happen once per record. *
****************************************************************
PROCESS EQU *
ST R10,SVPROC
BAL R10,CHKSEM See if new semester
AP #SEM,=P'1' Count sections by semester
BAL R10,CHKLNS
BAL R10,FORMAT
BAL R10,WRITE
BAL R10,READ
L R10,SVPROC
BR R10
****************************************************************
* READ - Read a record. *
****************************************************************
READ EQU *
ST R10,SVREAD
GET OFFER,IREC Read a single offer record
B READX
ATEND EQU *
MVI EOFSW,C'Y'
READX EQU *
L R10,SVREAD
BR R10
****************************************************************
* CHKSEM - Check for change in semester *
* (control break) *
****************************************************************
CHKSEM EQU *
ST R10,SVCHKSEM
CLC HOLDSEM,ISEM
BE CHKSEMX
BAL R10,ENDSEM
MVC HOLDSEM,ISEM
CHKSEMX EQU *
L R10,SVCHKSEM
BR R10
****************************************************************
* ENDSEM - End semester *
* (Process control break) *
* Show count of sections for this semester *
* Force next semester to another page *
****************************************************************
ENDSEM EQU *
ST R10,SVENDSEM
MVC OREC(40),BLANKS This area used several ways
BAL R10,WRITE Skip a line
MVC OREC+6(25),=C'*** Sem XXX BZZ9 sections'
MVC OREC+14(3),HOLDSEM
MVC OREC+18(4),=X'40202120'
ED OREC+18(4),#SEM
BAL R10,WRITE
MVC OREC(40),BLANKS
ZAP #SEM,=P'0' Reset counter
ZAP LNS,MAXLNS Force next sem. to new page
L R10,SVENDSEM
BR R10
****************************************************************
* CHKLNS - Check lines printed. Full page? *
****************************************************************
CHKLNS EQU *
ST R10,SVCHKLNS
CP LNS,MAXLNS
BL CHKLNSX
BAL R10,HDGS
CHKLNSX EQU *
L R10,SVCHKLNS
BR R10
****************************************************************
* FORMAT - Format a single detail line. *
****************************************************************
FORMAT EQU *
ST R10,SVFORM
MVC OREC(40),BLANKS
MVC OCID,ICID Course ID
MVC OSECT,ISECT Section number
MVC OTID,ITID Teacher ID
L R10,SVFORM
BR R10
****************************************************************
* WRITE - Write a single detail line. *
****************************************************************
WRITE EQU *
ST R10,SVWRITE
PUT REPORT,OREC Write report line
AP LNS,=P'1'
L R10,SVWRITE
BR R10
****************************************************************
* WRAPUP - Those things which happen one time only, *
* after all records have been processed. *
****************************************************************
WRAPUP EQU *
ST R10,SVWRAP
BAL R10,ENDSEM Final control break
CLOSE OFFER
CLOSE REPORT
WTO 'OFFER10B ... Course list on REPORT.TXT'
L R10,SVWRAP
BR R10
****************************************************************
* Literals, if any, will go here *
****************************************************************
LTORG
****************************************************************
* File definitions *
****************************************************************
OFFER DCB LRECL=16,RECFM=FT,MACRF=R,EODAD=ATEND, X
DDNAME=OFFER,RECORD=IREC
REPORT DCB LRECL=40,RECFM=FT,MACRF=W, X
DDNAME=REPORT
****************************************************************
* RETURN ADDRESSES *
****************************************************************
SVSETUP DC F'0' SETUP
SVHDGS DC F'0' HDGS
SVPROC DC F'0' PROCESS
SVREAD DC F'0' READ
SVFORM DC F'0' FORMAT
SVWRITE DC F'0' WRITE
SVWRAP DC F'0' WRAPUP
SVCHKLNS DC F'0' CHKLNS
SVCHKSEM DC F'0' CHKSEM
SVENDSEM DC F'0' ENDSEM
****************************************************************
* Miscellaneous field definitions *
****************************************************************
EOFSW DC CL1'N' End of file? (Y/N)
PGS DC PL2'0' Nbr of pages printed.
LNS DC PL2'10' Lines printed on this page.
MAXLNS DC PL2'10' Max nbr lines per page.
HOLDSEM DC CL3' ' Hold semester
#SEM DC PL2'0' Sem count
* My line counts exclude hdgs.
BLANKS DC CL40' '
****************************************************************
* Input record definition *
****************************************************************
IREC DS 0CL18 1-18 Offer record
ISEM DS CL3 1- 3 Semester
ICID DS 0CL5 4- 8 Course ID
IDEPT DS CL2 4- 5 Department
DS CL3 6- 8 Course number
ISECT DS CL1 9- 9 Section number
ITID DS CL3 10-12 Teacher ID
IROOM DS CL4 13-16 Room number
****************************************************************
* Output (line) definition *
****************************************************************
OREC DS 0CL40 1-40
DC CL10' ' 1- 10
OCID DS CL5 11-15 Course ID
DC CL6' ' 16-21
OSECT DS CL1 22-22 Section number
DC CL8' ' 23-30
OTID DS CL3 31-33 Teacher ID
DC CL7' ' 34-40
* Headings definitions *
****************************************************************
*
* ----+----1----+----2----+----3----+----4
* COURSE OFFERINGS PageBZZ9
* Semester W92
*
* Course Section Teacher
* ------ ------- -------
* XXXXX X XXX
* XXXXX X XXX
* XXXXX X XXX
*
FORMFEED DS 0CL40
* DC X'0C' EBCDIC formfeed
* DC CL39' '
DC 40C'_' For testing...
HD1 DS 0CL40
* ----+----1----+----2----+----3----+----4
DC CL36' COURSE OFFERINGS Page'
HDPGS DC CL4'BZZ9'
HD2 DS 0CL40
DC CL22' Semester '
HDSEM DS CL3'XXX'
DC CL15' '
HD3 DS 0CL40
DC CL40' Course Section Teacher '
HD4 DS 0CL40
DC CL40' ------ ------- ------- '
END BEGIN