WolffPack differences report |
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
|
*S****SAG GENERATOR: WW-OBJECT-SUBP Version: 3.2.2
*S****SAG TITLE: WFAIDYRO
*S****SAG SYSTEM: FINANCIER
*S****SAG OBJECT-DESC: record
*S****SAG PRIME-FILE: WF-AIDYEAR
*S****SAG PRIME-KEY: WF-AIDYEAR-KEY
*S****SAG HOLD-FIELD: WW-HOLD
*S****SAG OBJECT-PDA: WFAIDYRD
*S****SAG RESTRICTED-PDA: WFAIDYRR
*S****SAG DESCS(1): This subprogram performs I/O functions for the
*S****SAG DESCS(2): WF-AIDYEAR userview/file using the WF-AIDYEAR-KEY
*S****SAG DESCS(3): primary superdescriptor.
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Subprogram: WFAIDYRO
*S*** System : FINANCIER
*S*** Title : WFAIDYRO
*S*** Generated : Oct 12,02 at 04:17 PM
*S*** Function : This subprogram performs I/O functions for the
*S*** WF-AIDYEAR userview/file using the WF-AIDYEAR-KEY
*S*** primary superdescriptor.
*S***
*S***
*S*** Copyright 1995 - 2003 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S** PARAMETER USING WWPDA
*S***
*S** PARAMETER USING WFAIDYRD
*S** PARAMETER USING WFAIDYRR
*S** PARAMETER USING WWAOBJ
*S***
*S** LOCAL
*S***
*S*** Miscellaneous local variables.
*S** 01 #CURRENT-FIELD(A32) /* Current field name being proccessed
*S** 01 #DB-CALL(A1) /* D=Delete, U=Update, S=Store
*S** 01 #D1(P3) /* Temporary indices for MU and PE
*S** 01 #D2(P3)
*S** 01 #OBJECT(A20) INIT<'record'>
*S** 01 #OLD-REC(L) /* Record existed before.
*S** 01 #SAVE-REC(L) /* True if record is non-null.
*S** 01 #DISP-BACKOUT(L) INIT<TRUE> /* Display message on BACKOUT TRANS
*S** 01 #SAVE-MSG(A79) /* Save previously defined messages
*S***
*S*** Views used to build object.
*S***
*S*** View for histogram on NEXT action.
*S** 01 NEXT-VIEW VIEW OF WF-AIDYEAR
*S** 02 WF-AIDYEAR-KEY
*S***
*S*** Primary object entity.
*S** 01 WF-AIDYEAR VIEW OF WF-AIDYEAR
*S** 02 WW-STUDENT-ID
*S** 02 WF-FAO
*S** 02 WF-AID-YEAR
*S** 02 WW-SYSTEM
*S** 03 WW-HOLD
*S** 03 WW-CDATE
*S** 03 WW-MDATE
*S** 02 WF-AIDYEAR-ATTRIBUTES
*S** 03 WF-AY-SCHED
*S** 03 WF-AY-SCHED-FED
*S** 03 WF-AY-PAYMETH-FED
*S** 02 WF-AIDYEAR-NEEDANALYSIS
*S** 03 WF-AY-N-DUR
*S** 03 REDEFINE WF-AY-N-DUR
*S** 04 WF-AY-N-DUR-T(A2)
*S** 03 WF-AY-N-VREJ
*S** 03 WF-AY-N-M1
*S** 03 WF-AY-N-M2
*S** 03 WF-AY-N-M3
*S** 02 WF-AIDYEAR-BUDGET
*S** 03 WF-AY-B-C1-T
*S** 03 WF-AY-B-C2-T
*S** 03 WF-AY-B-C3-T
*S** 03 WF-AY-B-C4-T
*S** 03 WF-AY-B-C5-T
*S** 03 WF-AY-B-C6-T
*S** 03 WF-AY-B-C7-T
*S** 03 WF-AY-B-C8-T
*S** 03 WF-AY-B-M1-LOCK
*S** 03 WF-AY-B-M2-LOCK
*S** 03 WF-AY-B-M3-LOCK
*S** 03 WF-AY-B-M1-DTL
*S** 03 WF-AY-B-M2-DTL
*S** 03 WF-AY-B-M3-DTL
*S** 03 WF-AY-B-M1-GRP
*S** 03 WF-AY-B-M2-GRP
*S** 03 WF-AY-B-M3-GRP
*S** 03 WF-AY-B-SP1
*S** 03 WF-AY-B-SP2
*S** 03 WF-AY-B-SP3
*S** 02 WF-AIDYEAR-SAP
*S** 03 WF-AY-S-RT1-SAP
*S** 03 WF-AY-S-RT1-SAP-RSN
*S** 03 WF-AY-S-RT1-SAP-DATE
*S** 03 WF-AY-S-RT2-SAP
*S** 03 WF-AY-S-RT2-SAP-RSN
*S** 03 WF-AY-S-RT2-SAP-DATE
*S** 03 WF-AY-S-RT3-SAP
*S** 03 WF-AY-S-RT3-SAP-RSN
*S** 03 WF-AY-S-RT3-SAP-DATE
*S** 03 WF-AY-S-RT4-SAP
*S** 03 WF-AY-S-RT4-SAP-RSN
*S** 03 WF-AY-S-RT4-SAP-DATE
*S** 02 WF-AIDYEAR-AWARDS
*S** 03 WF-AY-W-AID
*S** 03 WF-AY-W-AID-MN
*S** 03 WF-AY-W-AID-FC
*S** 03 WF-AY-W-AID-SC
*S** 03 WF-AY-W-AID-PC
*S** 03 WF-AY-W-AID-ST
*S** 02 WF-AIDYEAR-METHODOLOGY1
*S** 03 WF-AY-M1-REJECT
*S** 03 WF-AY-M1-REJ1
*S** 03 WF-AY-M1-REJ2
*S** 03 WF-AY-M1-REJ3
*S** 03 WF-AY-M1-REJ4
*S** 03 WF-AY-M1-REJ5
*S** 03 WF-AY-M1-REJ6
*S** 03 WF-AY-M1-REJ7
*S** 03 WF-AY-M1-ASSUM
*S** 03 WF-AY-M1-DEP
*S** 03 WF-AY-M1-FISAP
*S** 03 WF-AY-M1-FC-OVR
*S** 03 WF-AY-M1-FC
*S** 03 WF-AY-M1-SANAL
*S** 03 WF-AY-M1-SC
*S** 03 WF-AY-M1-SCI
*S** 03 WF-AY-M1-SCA
*S** 03 WF-AY-M1-PANAL
*S** 03 WF-AY-M1-PC
*S** 03 WF-AY-M1-PCI
*S** 03 WF-AY-M1-PCA
*S** 03 WF-AY-M1-ORES
*S** 03 WF-AY-M1-BUDGET
*S** 03 WF-AY-M1-C1
*S** 03 WF-AY-M1-C2
*S** 03 WF-AY-M1-C3
*S** 03 WF-AY-M1-C4
*S** 03 WF-AY-M1-C5
*S** 03 WF-AY-M1-C6
*S** 03 WF-AY-M1-C7
*S** 03 WF-AY-M1-C8
*S** 03 WF-AY-M1-NEED
*S** 02 WF-AIDYEAR-METHODOLOGY2
*S** 03 WF-AY-M2-REJECT
*S** 03 WF-AY-M2-REJ1
*S** 03 WF-AY-M2-REJ2
*S** 03 WF-AY-M2-REJ3
*S** 03 WF-AY-M2-REJ4
*S** 03 WF-AY-M2-REJ5
*S** 03 WF-AY-M2-REJ6
*S** 03 WF-AY-M2-REJ7
*S** 03 WF-AY-M2-ASSUM
*S** 03 WF-AY-M2-DEP
*S** 03 WF-AY-M2-FISAP
*S** 03 WF-AY-M2-FC-OVR
*S** 03 WF-AY-M2-FC
*S** 03 WF-AY-M2-SANAL
*S** 03 WF-AY-M2-SC
*S** 03 WF-AY-M2-SCI
*S** 03 WF-AY-M2-SCA
*S** 03 WF-AY-M2-PANAL
*S** 03 WF-AY-M2-PC
*S** 03 WF-AY-M2-PCI
*S** 03 WF-AY-M2-PCA
*S** 03 WF-AY-M2-ORES
*S** 03 WF-AY-M2-BUDGET
*S** 03 WF-AY-M2-C1
*S** 03 WF-AY-M2-C2
*S** 03 WF-AY-M2-C3
*S** 03 WF-AY-M2-C4
*S** 03 WF-AY-M2-C5
*S** 03 WF-AY-M2-C6
*S** 03 WF-AY-M2-C7
*S** 03 WF-AY-M2-C8
*S** 03 WF-AY-M2-NEED
*S** 02 WF-AIDYEAR-METHODOLOGY3
*S** 03 WF-AY-M3-REJECT
*S** 03 WF-AY-M3-REJ1
*S** 03 WF-AY-M3-REJ2
*S** 03 WF-AY-M3-REJ3
*S** 03 WF-AY-M3-REJ4
*S** 03 WF-AY-M3-REJ5
*S** 03 WF-AY-M3-REJ6
*S** 03 WF-AY-M3-REJ7
*S** 03 WF-AY-M3-ASSUM
*S** 03 WF-AY-M3-DEP
*S** 03 WF-AY-M3-FISAP
*S** 03 WF-AY-M3-FC-OVR
*S** 03 WF-AY-M3-FC
*S** 03 WF-AY-M3-SANAL
*S** 03 WF-AY-M3-SC
*S** 03 WF-AY-M3-SCI
*S** 03 WF-AY-M3-SCA
*S** 03 WF-AY-M3-PANAL
*S** 03 WF-AY-M3-PC
*S** 03 WF-AY-M3-PCI
*S** 03 WF-AY-M3-PCA
*S** 03 WF-AY-M3-ORES
*S** 03 WF-AY-M3-BUDGET
*S** 03 WF-AY-M3-C1
*S** 03 WF-AY-M3-C2
*S** 03 WF-AY-M3-C3
*S** 03 WF-AY-M3-C4
*S** 03 WF-AY-M3-C5
*S** 03 WF-AY-M3-C6
*S** 03 WF-AY-M3-C7
*S** 03 WF-AY-M3-C8
*S** 03 WF-AY-M3-NEED
*S** 02 WF-AIDYEAR-APPLICATION
*S** 03 WF-AY-A-STAT
*S** 03 WF-AY-A-STAT-REQ
*S** 03 WF-AY-A-STAT-DATE
*S** 03 WF-AY-A-NOT-OVR
*S** 03 WF-AY-A-NOT-OVR-RSN
*S** 03 WF-AY-A-NOT-OVR-DATE
*S** 03 WF-AY-A-NOT-I-FMT
*S** 03 WF-AY-A-NOT-F-FMT
*S** 03 WF-AY-A-NOT-C-FMT
*S** 03 WF-AY-A-NOT-FREQ
*S** 03 WF-AY-A-NOT-MAX
*S** 03 WF-AY-A-NOT-START
*S** 03 WF-AY-A-NOT-STOP
*S** 03 WF-AY-A-NOT-TOTAL
*S** 03 WF-AY-A-NOT-TYPE
*S** 03 WF-AY-A-NOT-DATE
*S** 02 WF-AIDYEAR-PACKAGING
*S** 03 WF-AY-P-STAT
*S** 03 WF-AY-P-STAT-DATE
*S** 03 WF-AY-P-NOT-OVR
*S** 03 WF-AY-P-NOT-OVR-RSN
*S** 03 WF-AY-P-NOT-OVR-DATE
*S** 03 WF-AY-P-NOT-I-FMT
*S** 03 WF-AY-P-NOT-F-FMT
*S** 03 WF-AY-P-DEN-I-FMT
*S** 03 WF-AY-P-DEN-F-FMT
*S** 03 WF-AY-P-NOT-TOTAL
*S** 03 WF-AY-P-NOT-TYPE
*S** 03 WF-AY-P-NOT-DATE
*S** 02 WF-AIDYEAR-DISBURSEMENT
*S** 03 WF-AY-D-OVR
*S** 03 WF-AY-D-OVR-RSN
*S** 03 WF-AY-D-OVR-DATE
*S** 03 WF-AY-D-STAT
*S** 03 WF-AY-D-STAT-REQ
*S** 03 WF-AY-D-STAT-DATE
*S** 03 WF-AY-D-NOT-OVR
*S** 03 WF-AY-D-NOT-OVR-RSN
*S** 03 WF-AY-D-NOT-OVR-DATE
*S** 03 WF-AY-D-NOT-I-FMT
*S** 03 WF-AY-D-NOT-F-FMT
*S** 03 WF-AY-D-NOT-C-FMT
*S** 03 WF-AY-D-NOT-FREQ
*S** 03 WF-AY-D-NOT-MAX
*S** 03 WF-AY-D-NOT-START
*S** 03 WF-AY-D-NOT-STOP
*S** 03 WF-AY-D-NOT-TOTAL
*S** 03 WF-AY-D-NOT-TYPE
*S** 03 WF-AY-D-NOT-DATE
*S** 03 WF-AY-D-STOP-AR
*S** 03 WF-AY-D-INC-AR
*S**END-DEFINE
*S***
*S***
*S*** Populate WW-GDA from WW-PDA
*S**MOVE BY POSITION WW-PDA TO WW-GDA
*S***
*S***
*S*** Initialize output fields.
*S**ASSIGN #SAVE-MSG = ##MSG
*S**RESET WWAOBJ.OUTPUTS ##MSG ##MSG-DATA(*) ##RETURN-CODE
*S***
*S*** Build up prime key of the object.
*S**MOVE BY NAME WFAIDYRD TO WFAIDYRD-ID.STRUCTURE
*S***
*S*************************************************************************
*S***
*S*** Set up repeat to allow escape from within a subroutine.
*S**PROG.
*S**REPEAT
*S***
*S*** Decide what to do based on function supplied.
*S** DECIDE ON FIRST VALUE WWAOBJ.#FUNCTION
*S** VALUE 'GET' /* Read the object
*S** /*
*S** /* Object exists, get object
*S** PERFORM GET-OBJECT
*S** PERFORM SET-OBJECT-ID
*S** VALUE 'NEXT' /* Read the next higher object
*S** /*
*S** /* Histogram for next higher value from one in object.
*S** HISTOGRAM(2) NEXT-VIEW FOR WF-AIDYEAR-KEY
*S** STARTING FROM WFAIDYRD-ID
*S** IF NEXT-VIEW.WF-AIDYEAR-KEY NE WFAIDYRD-ID THEN
*S** ASSIGN WFAIDYRD-ID = NEXT-VIEW.WF-AIDYEAR-KEY
*S** MOVE BY NAME WFAIDYRD-ID.STRUCTURE TO WFAIDYRD
*S** PERFORM GET-OBJECT
*S** ASSIGN ##MSG-DATA(1) = #OBJECT
*S** ESCAPE BOTTOM
*S** END-IF
*S** END-HISTOGRAM
*S** /*
*S** /* No records beyond current record.
*S** IF NOT WWAOBJ.#EXISTS
*S** ASSIGN ##MSG = 'End of data reached'
*S** ASSIGN ##RETURN-CODE = 'W' /* Warning.
*S** END-IF
*S** VALUE 'UPDATE','DELETE' /* Modify or purge current object
*S** /*
*S** /* Make sure the record was held prior to updating.
*S** IF WFAIDYRD-ID NE WFAIDYRR.HELD-ID THEN
*S** ASSIGN ##MSG = 'Record not in held status'
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** PERFORM HOLD-OBJECT
*S** PERFORM SET-OBJECT-ID
*S** IF WWAOBJ.#FUNCTION = 'DELETE'
*S** ASSIGN ##MSG = 'Record purged successfully'
*S** END-IF
*S** VALUE 'EXISTS' /* Existence check
*S** PERFORM CLEAR
*S** PERFORM CHECK-EXISTENCE
*S** VALUE 'STORE' /* Add new object
*S** PERFORM CREATE-OBJECT
*S** PERFORM SET-OBJECT-ID
*S** VALUE 'INITIALIZE'
*S** PERFORM CLEAR
*S** ANY
*S** PERFORM RELOAD-MSG
*S** MOVE BY POSITION WW-GDA TO WW-PDA
*S** ESCAPE BOTTOM(PROG.) IMMEDIATE /* All done.
*S** NONE /* Unknown action code
*S** ASSIGN ##MSG-DATA(1) = #OBJECT
*S** ASSIGN ##MSG-DATA(2) = WWAOBJ.#FUNCTION
*S** ASSIGN ##MSG = 'Invalid:1:function specified::2:'
*S** PERFORM PROCESS-ERROR
*S** END-DECIDE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE PROCESS-ERROR
*S*************************************************************************
*S***
*S** IF ##MSG-DATA(1) = ' ' /* Set default for :1:.
*S** PERFORM SET-OBJECT-ID
*S** END-IF
*S** ASSIGN ##RETURN-CODE = 'E' /* Error.
*S** IF #DISP-BACKOUT
*S** WRITE 'Issuing Backout transaction for action:' #FUNCTION
*S** / ' in subprogram' *PROGRAM
*S** END-IF
*S** BACKOUT TRANSACTION
*S** MOVE BY POSITION WW-GDA TO WW-PDA
*S** ESCAPE BOTTOM(PROG.) IMMEDIATE
*S**END-SUBROUTINE /* PROCESS-ERROR
*S***
*S**END-REPEAT
*S***
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CREATE-OBJECT
*S*************************************************************************
*S***
*S** ASSIGN WFAIDYRD.WW-CDATE = *DATX
*S***
*S*** Don't allow the key to be null.
*S** IF WFAIDYRD-ID = NEXT-VIEW.WF-AIDYEAR-KEY /* Compare with null
*S** ASSIGN ##MSG-DATA(1) = #OBJECT
*S** ASSIGN ##MSG = ':1:identifier is required'
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** /*
*S** /* If object already exist, return with error.
*S** PERFORM CHECK-EXISTENCE
*S** IF WWAOBJ.#EXISTS THEN
*S** ASSIGN ##MSG = ':1:already exists'
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** PERFORM EDIT-OBJECT /* Pre-edit object header
*S** ASSIGN WF-AIDYEAR.WW-HOLD = *TIMN
*S** ASSIGN WFAIDYRR.INTERVENING-UPD-FLD =
*S** WF-AIDYEAR.WW-HOLD
*S** ASSIGN WFAIDYRR.HELD-ID = WFAIDYRD-ID
*S** STORE WF-AIDYEAR
*S**END-SUBROUTINE /* CREATE-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE GET-OBJECT
*S*************************************************************************
*S***
*S*** Get the primary object record.
*S** PERFORM CLEAR
*S** FIND WF-AIDYEAR WITH WF-AIDYEAR-KEY = WFAIDYRD-ID
*S** IF NO RECORDS FOUND
*S** /*
*S** /* Return the fact that the object does not exist.
*S** ESCAPE ROUTINE
*S** END-NOREC
*S** ASSIGN WWAOBJ.#EXISTS = TRUE
*S** /*
*S** /* "Hold" the record by capturing the value of the update flag.
*S** ASSIGN WFAIDYRR.INTERVENING-UPD-FLD =
*S** WF-AIDYEAR.WW-HOLD
*S** /*
*S** /* Shift primary entity information to object
*S** MOVE BY NAME WF-AIDYEAR TO WFAIDYRD
*S** ASSIGN WFAIDYRR.HELD-ID = WFAIDYRD-ID
*S** END-FIND
*S****SAG DEFINE EXIT AFTER-GET
*S** IF WFAIDYRD.WF-AY-SCHED NE ##SCHED-ID
*S** ASSIGN ##SCHED-ID = WFAIDYRD.WF-AY-SCHED
*S** ASSIGN ##PASS-TEMP = 'AIDYEAR-VERF'
*S** PERFORM LOAD-TABLE-INFORMATION
*S** RESET ##PASS-TEMP
*S** END-IF
*S****SAG END-EXIT
*S**END-SUBROUTINE /* GET-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE HOLD-OBJECT
*S*************************************************************************
*S***
*S*** Get primary entity and process it.
*S** HOLD-PRIME.
*S** FIND WF-AIDYEAR WITH
*S** WF-AIDYEAR-KEY = WFAIDYRD-ID
*S** IF NO RECORDS FOUND
*S** /*
*S** /* Trying to process an object that doesn't exist.
*S** ASSIGN ##MSG = 'Intervening purge, please try again'
*S** RESET WFAIDYRR
*S** PERFORM PROCESS-ERROR
*S** END-NOREC
*S** IF WFAIDYRR.INTERVENING-UPD-FLD NE
*S** WF-AIDYEAR.WW-HOLD THEN
*S** ASSIGN ##MSG = 'Intervening update, please try again'
*S** RESET WFAIDYRR
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** ASSIGN WWAOBJ.#EXISTS = TRUE
*S** PERFORM EDIT-OBJECT /* Pre-edit object header
*S** DECIDE ON EVERY VALUE WWAOBJ.#FUNCTION
*S** VALUE 'UPDATE'
*S** ASSIGN WF-AIDYEAR.WW-HOLD = *TIMN
*S** ASSIGN WF-AIDYEAR.WW-MDATE = *DATX
*S** ASSIGN WFAIDYRR.INTERVENING-UPD-FLD =
*S** WF-AIDYEAR.WW-HOLD
*S** UPDATE(HOLD-PRIME.)
*S** VALUE 'DELETE'
*S** DELETE(HOLD-PRIME.)
*S** RESET WFAIDYRR.HELD-ID
*S** NONE IGNORE
*S** END-DECIDE
*S** END-FIND
*S**END-SUBROUTINE /* HOLD-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CHECK-AND-UPDATE-OBJECT /* Process all sub-entities
*S*************************************************************************
*S***
*S** ESCAPE ROUTINE /* No sub-entities
*S**END-SUBROUTINE /* CHECK-AND-UPDATE-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE EDIT-OBJECT
*S*************************************************************************
*S***
*S** IF WWAOBJ.#FUNCTION = 'UPDATE' OR = 'STORE'
*S** /*
*S** /* Load file view
*S** MOVE BY NAME WFAIDYRD TO WF-AIDYEAR
*S** END-IF
*S**END-SUBROUTINE /* EDIT-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CHECK-EXISTENCE
*S*************************************************************************
*S***
*S*** Check whether object currently exists.
*S** EXISTENCE-CHECK.
*S** HISTOGRAM(1) NEXT-VIEW FOR WF-AIDYEAR-KEY
*S** FROM WFAIDYRD-ID THRU WFAIDYRD-ID
*S** ASSIGN WWAOBJ.#EXISTS = TRUE
*S** END-HISTOGRAM
*S**END-SUBROUTINE /* CHECK-EXISTENCE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CLEAR
*S*************************************************************************
*S***
*S** MOVE BY NAME WFAIDYRD TO WFAIDYRD-ID.STRUCTURE /* Capture key.
*S** RESET WFAIDYRD WFAIDYRR
*S** /*
*S** /* Reset redefined components whose formats differ from base field
*S** RESET WFAIDYRD.WF-AY-N-DUR-T
*S** MOVE BY NAME WFAIDYRD-ID.STRUCTURE TO WFAIDYRD /* Restore key.
*S**END-SUBROUTINE /* CLEAR
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE GET-DB-CALL
*S*************************************************************************
*S***
*S**INCLUDE WWDBCALL
*S**END-SUBROUTINE /* GET-DB-CALL
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE SET-OBJECT-ID
*S*************************************************************************
*S***
*S** COMPRESS WFAIDYRD.WF-AID-YEAR
*S** '-' WFAIDYRD.WF-FAO
*S** '-' WFAIDYRD.WW-STUDENT-ID
*S** TO ##MSG-DATA(1) LEAVING NO
*S** COMPRESS #OBJECT ##MSG-DATA(1) TO ##MSG-DATA(1)
*S**END-SUBROUTINE /* SET-OBJECT-ID
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE RELOAD-MSG
*S*************************************************************************
*S***
*S*** If no messages set in subprogram, reset passed message
*S** IF ##MSG = ' '
*S** ASSIGN ##MSG = #SAVE-MSG
*S** END-IF
*S**END-SUBROUTINE /* RELOAD-MSG
*S**END
|
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
|
*S****SAG GENERATOR: WW-OBJECT-SUBP Version: 3.2.2
*S****SAG TITLE: WFAIDYRO
*S****SAG SYSTEM: FINANCIER
*S****SAG OBJECT-DESC: record
*S****SAG PRIME-FILE: WF-AIDYEAR
*S****SAG PRIME-KEY: WF-AIDYEAR-KEY
*S****SAG HOLD-FIELD: WW-HOLD
*S****SAG OBJECT-PDA: WFAIDYRD
*S****SAG RESTRICTED-PDA: WFAIDYRR
*S****SAG DESCS(1): This subprogram performs I/O functions for the
*S****SAG DESCS(2): WF-AIDYEAR userview/file using the WF-AIDYEAR-KEY
*S****SAG DESCS(3): primary superdescriptor.
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Subprogram: WFAIDYRO
*S*** System : FINANCIER
*S*** Title : WFAIDYRO
*S*** Generated : Oct 12,02 at 04:17 PM
*S*** Function : This subprogram performs I/O functions for the
*S*** WF-AIDYEAR userview/file using the WF-AIDYEAR-KEY
*S*** primary superdescriptor.
*S***
*S***
*S*** Copyright 1995 - 2003 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S** PARAMETER USING WWPDA
*S***
*S** PARAMETER USING WFAIDYRD
*S** PARAMETER USING WFAIDYRR
*S** PARAMETER USING WWAOBJ
*S***
*S** LOCAL
*S***
*S*** Miscellaneous local variables.
*S** 01 #CURRENT-FIELD(A32) /* Current field name being proccessed
*S** 01 #DB-CALL(A1) /* D=Delete, U=Update, S=Store
*S** 01 #D1(P3) /* Temporary indices for MU and PE
*S** 01 #D2(P3)
*S** 01 #OBJECT(A20) INIT<'record'>
*S** 01 #OLD-REC(L) /* Record existed before.
*S** 01 #SAVE-REC(L) /* True if record is non-null.
*S** 01 #DISP-BACKOUT(L) INIT<TRUE> /* Display message on BACKOUT TRANS
*S** 01 #SAVE-MSG(A79) /* Save previously defined messages
*S***
*S*** Views used to build object.
*S***
*S*** View for histogram on NEXT action.
*S** 01 NEXT-VIEW VIEW OF WF-AIDYEAR
*S** 02 WF-AIDYEAR-KEY
*S***
*S*** Primary object entity.
*S** 01 WF-AIDYEAR VIEW OF WF-AIDYEAR
*S** 02 WW-STUDENT-ID
*S** 02 WF-FAO
*S** 02 WF-AID-YEAR
*S** 02 WW-SYSTEM
*S** 03 WW-HOLD
*S** 03 WW-CDATE
*S** 03 WW-MDATE
*S** 02 WF-AIDYEAR-ATTRIBUTES
*S** 03 WF-AY-SCHED
*S** 03 WF-AY-SCHED-FED
*S** 03 WF-AY-PAYMETH-FED
*S** 02 WF-AIDYEAR-NEEDANALYSIS
*S** 03 WF-AY-N-DUR
*S** 03 REDEFINE WF-AY-N-DUR
*S** 04 WF-AY-N-DUR-T(A2)
*S** 03 WF-AY-N-VREJ
*S** 03 WF-AY-N-M1
*S** 03 WF-AY-N-M2
*S** 03 WF-AY-N-M3
*S** 02 WF-AIDYEAR-BUDGET
*S** 03 WF-AY-B-C1-T
*S** 03 WF-AY-B-C2-T
*S** 03 WF-AY-B-C3-T
*S** 03 WF-AY-B-C4-T
*S** 03 WF-AY-B-C5-T
*S** 03 WF-AY-B-C6-T
*S** 03 WF-AY-B-C7-T
*S** 03 WF-AY-B-C8-T
*S** 03 WF-AY-B-M1-LOCK
*S** 03 WF-AY-B-M2-LOCK
*S** 03 WF-AY-B-M3-LOCK
*S** 03 WF-AY-B-M1-DTL
*S** 03 WF-AY-B-M2-DTL
*S** 03 WF-AY-B-M3-DTL
*S** 03 WF-AY-B-M1-GRP
*S** 03 WF-AY-B-M2-GRP
*S** 03 WF-AY-B-M3-GRP
*S** 03 WF-AY-B-SP1
*S** 03 WF-AY-B-SP2
*S** 03 WF-AY-B-SP3
*S** 02 WF-AIDYEAR-SAP
*S** 03 WF-AY-S-RT1-SAP
*S** 03 WF-AY-S-RT1-SAP-RSN
*S** 03 WF-AY-S-RT1-SAP-DATE
*S** 03 WF-AY-S-RT2-SAP
*S** 03 WF-AY-S-RT2-SAP-RSN
*S** 03 WF-AY-S-RT2-SAP-DATE
*S** 03 WF-AY-S-RT3-SAP
*S** 03 WF-AY-S-RT3-SAP-RSN
*S** 03 WF-AY-S-RT3-SAP-DATE
*S** 03 WF-AY-S-RT4-SAP
*S** 03 WF-AY-S-RT4-SAP-RSN
*S** 03 WF-AY-S-RT4-SAP-DATE
*S** 02 WF-AIDYEAR-AWARDS
*S** 03 WF-AY-W-AID
*S** 03 WF-AY-W-AID-MN
*S** 03 WF-AY-W-AID-FC
*S** 03 WF-AY-W-AID-SC
*S** 03 WF-AY-W-AID-PC
*S** 03 WF-AY-W-AID-ST
*S** 02 WF-AIDYEAR-METHODOLOGY1
*S** 03 WF-AY-M1-REJECT
*S** 03 WF-AY-M1-REJ1
*S** 03 WF-AY-M1-REJ2
*S** 03 WF-AY-M1-REJ3
*S** 03 WF-AY-M1-REJ4
*S** 03 WF-AY-M1-REJ5
*S** 03 WF-AY-M1-REJ6
*S** 03 WF-AY-M1-REJ7
*S** 03 WF-AY-M1-ASSUM
*S** 03 WF-AY-M1-DEP
*S** 03 WF-AY-M1-FISAP
*S** 03 WF-AY-M1-FC-OVR
*S** 03 WF-AY-M1-FC
*S** 03 WF-AY-M1-SANAL
*S** 03 WF-AY-M1-SC
*S** 03 WF-AY-M1-SCI
*S** 03 WF-AY-M1-SCA
*S** 03 WF-AY-M1-PANAL
*S** 03 WF-AY-M1-PC
*S** 03 WF-AY-M1-PCI
*S** 03 WF-AY-M1-PCA
*S** 03 WF-AY-M1-ORES
*S** 03 WF-AY-M1-BUDGET
*S** 03 WF-AY-M1-C1
*S** 03 WF-AY-M1-C2
*S** 03 WF-AY-M1-C3
*S** 03 WF-AY-M1-C4
*S** 03 WF-AY-M1-C5
*S** 03 WF-AY-M1-C6
*S** 03 WF-AY-M1-C7
*S** 03 WF-AY-M1-C8
*S** 03 WF-AY-M1-NEED
*S** 02 WF-AIDYEAR-METHODOLOGY2
*S** 03 WF-AY-M2-REJECT
*S** 03 WF-AY-M2-REJ1
*S** 03 WF-AY-M2-REJ2
*S** 03 WF-AY-M2-REJ3
*S** 03 WF-AY-M2-REJ4
*S** 03 WF-AY-M2-REJ5
*S** 03 WF-AY-M2-REJ6
*S** 03 WF-AY-M2-REJ7
*S** 03 WF-AY-M2-ASSUM
*S** 03 WF-AY-M2-DEP
*S** 03 WF-AY-M2-FISAP
*S** 03 WF-AY-M2-FC-OVR
*S** 03 WF-AY-M2-FC
*S** 03 WF-AY-M2-SANAL
*S** 03 WF-AY-M2-SC
*S** 03 WF-AY-M2-SCI
*S** 03 WF-AY-M2-SCA
*S** 03 WF-AY-M2-PANAL
*S** 03 WF-AY-M2-PC
*S** 03 WF-AY-M2-PCI
*S** 03 WF-AY-M2-PCA
*S** 03 WF-AY-M2-ORES
*S** 03 WF-AY-M2-BUDGET
*S** 03 WF-AY-M2-C1
*S** 03 WF-AY-M2-C2
*S** 03 WF-AY-M2-C3
*S** 03 WF-AY-M2-C4
*S** 03 WF-AY-M2-C5
*S** 03 WF-AY-M2-C6
*S** 03 WF-AY-M2-C7
*S** 03 WF-AY-M2-C8
*S** 03 WF-AY-M2-NEED
*S** 02 WF-AIDYEAR-METHODOLOGY3
*S** 03 WF-AY-M3-REJECT
*S** 03 WF-AY-M3-REJ1
*S** 03 WF-AY-M3-REJ2
*S** 03 WF-AY-M3-REJ3
*S** 03 WF-AY-M3-REJ4
*S** 03 WF-AY-M3-REJ5
*S** 03 WF-AY-M3-REJ6
*S** 03 WF-AY-M3-REJ7
*S** 03 WF-AY-M3-ASSUM
*S** 03 WF-AY-M3-DEP
*S** 03 WF-AY-M3-FISAP
*S** 03 WF-AY-M3-FC-OVR
*S** 03 WF-AY-M3-FC
*S** 03 WF-AY-M3-SANAL
*S** 03 WF-AY-M3-SC
*S** 03 WF-AY-M3-SCI
*S** 03 WF-AY-M3-SCA
*S** 03 WF-AY-M3-PANAL
*S** 03 WF-AY-M3-PC
*S** 03 WF-AY-M3-PCI
*S** 03 WF-AY-M3-PCA
*S** 03 WF-AY-M3-ORES
*S** 03 WF-AY-M3-BUDGET
*S** 03 WF-AY-M3-C1
*S** 03 WF-AY-M3-C2
*S** 03 WF-AY-M3-C3
*S** 03 WF-AY-M3-C4
*S** 03 WF-AY-M3-C5
*S** 03 WF-AY-M3-C6
*S** 03 WF-AY-M3-C7
*S** 03 WF-AY-M3-C8
*S** 03 WF-AY-M3-NEED
*S** 02 WF-AIDYEAR-APPLICATION
*S** 03 WF-AY-A-STAT
*S** 03 WF-AY-A-STAT-REQ
*S** 03 WF-AY-A-STAT-DATE
*S** 03 WF-AY-A-NOT-OVR
*S** 03 WF-AY-A-NOT-OVR-RSN
*S** 03 WF-AY-A-NOT-OVR-DATE
*S** 03 WF-AY-A-NOT-I-FMT
*S** 03 WF-AY-A-NOT-F-FMT
*S** 03 WF-AY-A-NOT-C-FMT
*S** 03 WF-AY-A-NOT-FREQ
*S** 03 WF-AY-A-NOT-MAX
*S** 03 WF-AY-A-NOT-START
*S** 03 WF-AY-A-NOT-STOP
*S** 03 WF-AY-A-NOT-TOTAL
*S** 03 WF-AY-A-NOT-TYPE
*S** 03 WF-AY-A-NOT-DATE
*S** 02 WF-AIDYEAR-PACKAGING
*S** 03 WF-AY-P-STAT
*S** 03 WF-AY-P-STAT-DATE
*S** 03 WF-AY-P-NOT-OVR
*S** 03 WF-AY-P-NOT-OVR-RSN
*S** 03 WF-AY-P-NOT-OVR-DATE
*S** 03 WF-AY-P-NOT-I-FMT
*S** 03 WF-AY-P-NOT-F-FMT
*S** 03 WF-AY-P-DEN-I-FMT
*S** 03 WF-AY-P-DEN-F-FMT
*S** 03 WF-AY-P-NOT-TOTAL
*S** 03 WF-AY-P-NOT-TYPE
*S** 03 WF-AY-P-NOT-DATE
*S** 02 WF-AIDYEAR-DISBURSEMENT
*S** 03 WF-AY-D-OVR
*S** 03 WF-AY-D-OVR-RSN
*S** 03 WF-AY-D-OVR-DATE
*S** 03 WF-AY-D-STAT
*S** 03 WF-AY-D-STAT-REQ
*S** 03 WF-AY-D-STAT-DATE
*S** 03 WF-AY-D-NOT-OVR
*S** 03 WF-AY-D-NOT-OVR-RSN
*S** 03 WF-AY-D-NOT-OVR-DATE
*S** 03 WF-AY-D-NOT-I-FMT
*S** 03 WF-AY-D-NOT-F-FMT
*S** 03 WF-AY-D-NOT-C-FMT
*S** 03 WF-AY-D-NOT-FREQ
*S** 03 WF-AY-D-NOT-MAX
*S** 03 WF-AY-D-NOT-START
*S** 03 WF-AY-D-NOT-STOP
*S** 03 WF-AY-D-NOT-TOTAL
*S** 03 WF-AY-D-NOT-TYPE
*S** 03 WF-AY-D-NOT-DATE
*S** 03 WF-AY-D-STOP-AR
*S** 03 WF-AY-D-INC-AR
*S** 02 WF-AY-S-HSG
*S** 02 WF-AY-S-INT-WS
*S**END-DEFINE
*S***
*S***
*S*** Populate WW-GDA from WW-PDA
*S**MOVE BY POSITION WW-PDA TO WW-GDA
*S***
*S***
*S*** Initialize output fields.
*S**ASSIGN #SAVE-MSG = ##MSG
*S**RESET WWAOBJ.OUTPUTS ##MSG ##MSG-DATA(*) ##RETURN-CODE
*S***
*S*** Build up prime key of the object.
*S**MOVE BY NAME WFAIDYRD TO WFAIDYRD-ID.STRUCTURE
*S***
*S*************************************************************************
*S***
*S*** Set up repeat to allow escape from within a subroutine.
*S**PROG.
*S**REPEAT
*S***
*S*** Decide what to do based on function supplied.
*S** DECIDE ON FIRST VALUE WWAOBJ.#FUNCTION
*S** VALUE 'GET' /* Read the object
*S** /*
*S** /* Object exists, get object
*S** PERFORM GET-OBJECT
*S** PERFORM SET-OBJECT-ID
*S** VALUE 'NEXT' /* Read the next higher object
*S** /*
*S** /* Histogram for next higher value from one in object.
*S** HISTOGRAM(2) NEXT-VIEW FOR WF-AIDYEAR-KEY
*S** STARTING FROM WFAIDYRD-ID
*S** IF NEXT-VIEW.WF-AIDYEAR-KEY NE WFAIDYRD-ID THEN
*S** ASSIGN WFAIDYRD-ID = NEXT-VIEW.WF-AIDYEAR-KEY
*S** MOVE BY NAME WFAIDYRD-ID.STRUCTURE TO WFAIDYRD
*S** PERFORM GET-OBJECT
*S** ASSIGN ##MSG-DATA(1) = #OBJECT
*S** ESCAPE BOTTOM
*S** END-IF
*S** END-HISTOGRAM
*S** /*
*S** /* No records beyond current record.
*S** IF NOT WWAOBJ.#EXISTS
*S** ASSIGN ##MSG = 'End of data reached'
*S** ASSIGN ##RETURN-CODE = 'W' /* Warning.
*S** END-IF
*S** VALUE 'UPDATE','DELETE' /* Modify or purge current object
*S** /*
*S** /* Make sure the record was held prior to updating.
*S** IF WFAIDYRD-ID NE WFAIDYRR.HELD-ID THEN
*S** ASSIGN ##MSG = 'Record not in held status'
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** PERFORM HOLD-OBJECT
*S** PERFORM SET-OBJECT-ID
*S** IF WWAOBJ.#FUNCTION = 'DELETE'
*S** ASSIGN ##MSG = 'Record purged successfully'
*S** END-IF
*S** VALUE 'EXISTS' /* Existence check
*S** PERFORM CLEAR
*S** PERFORM CHECK-EXISTENCE
*S** VALUE 'STORE' /* Add new object
*S** PERFORM CREATE-OBJECT
*S** PERFORM SET-OBJECT-ID
*S** VALUE 'INITIALIZE'
*S** PERFORM CLEAR
*S** ANY
*S** PERFORM RELOAD-MSG
*S** MOVE BY POSITION WW-GDA TO WW-PDA
*S** ESCAPE BOTTOM(PROG.) IMMEDIATE /* All done.
*S** NONE /* Unknown action code
*S** ASSIGN ##MSG-DATA(1) = #OBJECT
*S** ASSIGN ##MSG-DATA(2) = WWAOBJ.#FUNCTION
*S** ASSIGN ##MSG = 'Invalid:1:function specified::2:'
*S** PERFORM PROCESS-ERROR
*S** END-DECIDE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE PROCESS-ERROR
*S*************************************************************************
*S***
*S** IF ##MSG-DATA(1) = ' ' /* Set default for :1:.
*S** PERFORM SET-OBJECT-ID
*S** END-IF
*S** ASSIGN ##RETURN-CODE = 'E' /* Error.
*S** IF #DISP-BACKOUT
*S** WRITE 'Issuing Backout transaction for action:' #FUNCTION
*S** / ' in subprogram' *PROGRAM
*S** END-IF
*S** BACKOUT TRANSACTION
*S** MOVE BY POSITION WW-GDA TO WW-PDA
*S** ESCAPE BOTTOM(PROG.) IMMEDIATE
*S**END-SUBROUTINE /* PROCESS-ERROR
*S***
*S**END-REPEAT
*S***
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CREATE-OBJECT
*S*************************************************************************
*S***
*S** ASSIGN WFAIDYRD.WW-CDATE = *DATX
*S***
*S*** Don't allow the key to be null.
*S** IF WFAIDYRD-ID = NEXT-VIEW.WF-AIDYEAR-KEY /* Compare with null
*S** ASSIGN ##MSG-DATA(1) = #OBJECT
*S** ASSIGN ##MSG = ':1:identifier is required'
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** /*
*S** /* If object already exist, return with error.
*S** PERFORM CHECK-EXISTENCE
*S** IF WWAOBJ.#EXISTS THEN
*S** ASSIGN ##MSG = ':1:already exists'
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** PERFORM EDIT-OBJECT /* Pre-edit object header
*S** ASSIGN WF-AIDYEAR.WW-HOLD = *TIMN
*S** ASSIGN WFAIDYRR.INTERVENING-UPD-FLD =
*S** WF-AIDYEAR.WW-HOLD
*S** ASSIGN WFAIDYRR.HELD-ID = WFAIDYRD-ID
*S** STORE WF-AIDYEAR
*S**END-SUBROUTINE /* CREATE-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE GET-OBJECT
*S*************************************************************************
*S***
*S*** Get the primary object record.
*S** PERFORM CLEAR
*S** FIND WF-AIDYEAR WITH WF-AIDYEAR-KEY = WFAIDYRD-ID
*S** IF NO RECORDS FOUND
*S** /*
*S** /* Return the fact that the object does not exist.
*S** ESCAPE ROUTINE
*S** END-NOREC
*S** ASSIGN WWAOBJ.#EXISTS = TRUE
*S** /*
*S** /* "Hold" the record by capturing the value of the update flag.
*S** ASSIGN WFAIDYRR.INTERVENING-UPD-FLD =
*S** WF-AIDYEAR.WW-HOLD
*S** /*
*S** /* Shift primary entity information to object
*S** MOVE BY NAME WF-AIDYEAR TO WFAIDYRD
*S** ASSIGN WFAIDYRR.HELD-ID = WFAIDYRD-ID
*S** END-FIND
*S****SAG DEFINE EXIT AFTER-GET
*S** IF WFAIDYRD.WF-AY-SCHED NE ##SCHED-ID
*S** ASSIGN ##SCHED-ID = WFAIDYRD.WF-AY-SCHED
*S** ASSIGN ##PASS-TEMP = 'AIDYEAR-VERF'
*S** PERFORM LOAD-TABLE-INFORMATION
*S** RESET ##PASS-TEMP
*S** END-IF
*S****SAG END-EXIT
*S**END-SUBROUTINE /* GET-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE HOLD-OBJECT
*S*************************************************************************
*S***
*S*** Get primary entity and process it.
*S** HOLD-PRIME.
*S** FIND WF-AIDYEAR WITH
*S** WF-AIDYEAR-KEY = WFAIDYRD-ID
*S** IF NO RECORDS FOUND
*S** /*
*S** /* Trying to process an object that doesn't exist.
*S** ASSIGN ##MSG = 'Intervening purge, please try again'
*S** RESET WFAIDYRR
*S** PERFORM PROCESS-ERROR
*S** END-NOREC
*S** IF WFAIDYRR.INTERVENING-UPD-FLD NE
*S** WF-AIDYEAR.WW-HOLD THEN
*S** ASSIGN ##MSG = 'Intervening update, please try again'
*S** RESET WFAIDYRR
*S** PERFORM PROCESS-ERROR
*S** END-IF
*S** ASSIGN WWAOBJ.#EXISTS = TRUE
*S** PERFORM EDIT-OBJECT /* Pre-edit object header
*S** DECIDE ON EVERY VALUE WWAOBJ.#FUNCTION
*S** VALUE 'UPDATE'
*S** ASSIGN WF-AIDYEAR.WW-HOLD = *TIMN
*S** ASSIGN WF-AIDYEAR.WW-MDATE = *DATX
*S** ASSIGN WFAIDYRR.INTERVENING-UPD-FLD =
*S** WF-AIDYEAR.WW-HOLD
*S** UPDATE(HOLD-PRIME.)
*S** VALUE 'DELETE'
*S** DELETE(HOLD-PRIME.)
*S** RESET WFAIDYRR.HELD-ID
*S** NONE IGNORE
*S** END-DECIDE
*S** END-FIND
*S**END-SUBROUTINE /* HOLD-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CHECK-AND-UPDATE-OBJECT /* Process all sub-entities
*S*************************************************************************
*S***
*S** ESCAPE ROUTINE /* No sub-entities
*S**END-SUBROUTINE /* CHECK-AND-UPDATE-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE EDIT-OBJECT
*S*************************************************************************
*S***
*S** IF WWAOBJ.#FUNCTION = 'UPDATE' OR = 'STORE'
*S** /*
*S** /* Load file view
*S** MOVE BY NAME WFAIDYRD TO WF-AIDYEAR
*S** END-IF
*S**END-SUBROUTINE /* EDIT-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CHECK-EXISTENCE
*S*************************************************************************
*S***
*S*** Check whether object currently exists.
*S** EXISTENCE-CHECK.
*S** HISTOGRAM(1) NEXT-VIEW FOR WF-AIDYEAR-KEY
*S** FROM WFAIDYRD-ID THRU WFAIDYRD-ID
*S** ASSIGN WWAOBJ.#EXISTS = TRUE
*S** END-HISTOGRAM
*S**END-SUBROUTINE /* CHECK-EXISTENCE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CLEAR
*S*************************************************************************
*S***
*S** MOVE BY NAME WFAIDYRD TO WFAIDYRD-ID.STRUCTURE /* Capture key.
*S** RESET WFAIDYRD WFAIDYRR
*S** /*
*S** /* Reset redefined components whose formats differ from base field
*S** RESET WFAIDYRD.WF-AY-N-DUR-T
*S** MOVE BY NAME WFAIDYRD-ID.STRUCTURE TO WFAIDYRD /* Restore key.
*S**END-SUBROUTINE /* CLEAR
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE GET-DB-CALL
*S*************************************************************************
*S***
*S**INCLUDE WWDBCALL
*S**END-SUBROUTINE /* GET-DB-CALL
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE SET-OBJECT-ID
*S*************************************************************************
*S***
*S** COMPRESS WFAIDYRD.WF-AID-YEAR
*S** '-' WFAIDYRD.WF-FAO
*S** '-' WFAIDYRD.WW-STUDENT-ID
*S** TO ##MSG-DATA(1) LEAVING NO
*S** COMPRESS #OBJECT ##MSG-DATA(1) TO ##MSG-DATA(1)
*S**END-SUBROUTINE /* SET-OBJECT-ID
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE RELOAD-MSG
*S*************************************************************************
*S***
*S*** If no messages set in subprogram, reset passed message
*S** IF ##MSG = ' '
*S** ASSIGN ##MSG = #SAVE-MSG
*S** END-IF
*S**END-SUBROUTINE /* RELOAD-MSG
*S**END
|