C:\Documents and Settings\Dan\My Documents\share\FINANCIER\releases\Natural\1210-99\old\wfaudawp.txt
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
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Program : WFAUDAWP
*S*** System : FINANCIER
*S*** Title : Award audit program
*S*** Function : This program displays a student's award audit history.
*S***
*S*** Copyright 1995 - 2003 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S***
*S** LOCAL USING WWAUDTWD /* Passed to Object Subprogram WWAUDTWO
*S** LOCAL USING WWAUDTWR /* Passed to Object Subprogram WWAUDTWO
*S** LOCAL USING WWAUDTWS /* Shadow file PDA
*S** LOCAL USING WWAOBJ /* Passed to Object Subprograms
*S***
*S** LOCAL USING WWCONST /* Constants LDA
*S** LOCAL USING WWDIALDA /* Local data for dialog objects.
*S** LOCAL USING WWENVIRA /* Used to capture/restore previous environment.
*S** LOCAL USING WWKEYLDA /* Used to set function keys + their alias.
*S** LOCAL USING WWVALLDA /* Valid value LDA
*S***
*S** LOCAL
*S***
*S*** Constants.
*S** 01 #MAX-PAGES(P3) CONST<2> /* Maximum scroll pages.
*S** 01 #MAX-ARRAY-ENTR(P3) CONST<13> /* Maximum array entries.
*S** 01 #UNCONDITIONALLY(L) CONST<TRUE> /* Used to REJECT always.
*S***
*S*** Miscellaneous variables.
*S** 01 #CURS-LINE(P5) /* Cursor select line.
*S** 01 #END-OF-DATA(L) /* End of logical read.
*S** 01 #END-OF-PAGE-LINE(P5) /* Line number where EOP starts.
*S** 01 #FIRST
*S** 02 #KY(A32) /* 1st KEY when looking for match.
*S** 01 #FIRST-INPUT(L) INIT<TRUE> /* Trigger End of Page.
*S** 01 #FIRST-KEY-FOUND(L) /* First unique value found.
*S** 01 #FIRST-TIME-REV(L) /* First reverse.
*S** 01 #FORWARD(L) INIT<TRUE> /* Not backwards left or right.
*S** 01 #BYPASS-READ(L) /* No paging
*S** 01 #SUB(P3)
*S** 01 #CNT(P3)
*S** 01 #NEXT(L)
*S** /*
*S** /* Variables utilized by Requirement routine
*S** 01 #REQMNTS(3)
*S** 02 #REQMNT-TYPE(A1) /* (A/Application, D/Disbursement)
*S** INIT (1)<' '> (2)<' '> (3)<' '>
*S** 02 #REQMNT-DOC(A6) /* Document mnemonic
*S** INIT (1)<' '> (2)<' '> (3)<' '>
*S** 02 #REQMNT-PD(A2) /* (ST/Student, AY/Aid Year)
*S** INIT (1)<' '> (2)<' '> (3)<' '>
*S** /*
*S** /* Define input fields.
*S** 01 #INPUT
*S** 02 #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WF-AID-YEAR(A4)
*S** 03 WF-FAO(A2)
*S** 03 WF-AWARD-ID(A18)
*S** 03 WW-CTIME(T)
*S** 02 REDEFINE #KY
*S** 03 WW-AUDIT-KEY(A32) /* Input key value.
*S** 01 #END-KEY /* End of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WF-AID-YEAR(A4)
*S** 02 WF-FAO(A2)
*S** 02 WF-AWARD-ID(A18)
*S** 02 WW-CTIME(T)
*S** 01 REDEFINE #END-KEY
*S** 02 #END-KEY-RED(A32)
*S** 01 #BEGIN-KEY /* Beginning of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WF-AID-YEAR(A4)
*S** 02 WF-FAO(A2)
*S** 02 WF-AWARD-ID(A18)
*S** 02 WW-CTIME(T)
*S** 01 REDEFINE #BEGIN-KEY
*S** 02 #BEGIN-KEY-RED(A32)
*S***
*S** 01 #INSIDE-READ-LOOP(L) /* Executing statement inside read.
*S***
*S*** Value of the scroll key on current record
*S** 01 #KEY(A32) /* Key field of record.
*S** 01 #MATCH-FOUND(L) /* Matched Unique Id from table.
*S** 01 #NR-HEAD-LINES(P3) INIT<3> /* 2 headings + Skip.
*S** 01 #NULL-KEY(A32) /* Empty key value.
*S** 01 #PANEL(P3) INIT<1> /* Left/Right panel number.
*S** 01 #SCR-CV(C) INIT<(AD=I)> /* Determine if any field modified.
*S***
*S*** Tables for backward/sideways scrolling feature
*S*** 01 #SCROLL-TBL(1:12)
*S*** 02 #KY(A22) /* Store top key/page.
*S*** 02 #REV-DATE(D)
*S*** 02 #REV-TIME(T)
*S** 01 #SEL-INDX(P5) /* Select table index.
*S** 01 #SEL-TBL(1:#MAX-ARRAY-ENTR) /* Selection table
*S** 02 #KY(A32)
*S** 02 REDEFINE #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WF-AID-YEAR(A4)
*S** 03 WF-FAO(A2)
*S** 03 WF-AWARD-ID(A18)
*S** 03 WW-CTIME(T)
*S** 01 #SELECTED-KEY(A32) /* Key of selected record.
*S** 01 #DISPLAYED-KEY(A1) /* Required for WWSTDKEY LDA
*S***
*S*** Key value for starting position of read.
*S** 01 #START
*S** 02 #KY(A32)
*S** 01 #STD-KEY-PRESSED(L) /* Quit, Return, Flip, Main.
*S** 01 #TOP-OF-PAGE(L) /* Top of Page was triggered.
*S** 01 #END-DATA-REVERSE(L)
*S** 01 #END-DATA-FORWARD(L)
*S***
*S** 01 #LOW-KY(A32)
*S** 01 #HIGH-KY(A32)
*S***
*S** 01 #ARRAYS /* Array of multiple records
*S** 02 #ARRAY-DATE(A10/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-AC(A2/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-AMT(A10/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-OFF(A9/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-ACC(A9/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-DIS(A9/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-DIST(A1/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-USER(A8/1:#MAX-ARRAY-ENTR)
*S** 02 #TAB-AUD(A1/1:#MAX-ARRAY-ENTR)
*S** 02 #TAB-AUD-CV(C/1:#MAX-ARRAY-ENTR)
*S** 01 #HOLD-FIELDS
*S** 02 #LAST-FILE(A8)
*S** 02 #LAST-USER(A8)
*S** 02 #LAST-DATE(D)
*S** 01 #BYPASS-INPUT (L) /* Bypass
*S**END-DEFINE
*S***
*S**FORMAT ES=ON /* ES suppresses (WRITE ' ') output,
*S** /* needed for newpage processing
*S**PERFORM INITIALIZATIONS
*S***
*S**PROG.
*S**REPEAT /* Repeat loop to allow escape of program from within subroutine.
*S***
*S*************************************************************************
*S***
*S** IF #SELECTED-KEY = SPACE
*S** RESET #INPUT.WW-AUDIT-KEY
*S** END-IF
*S** IF SUBSTRING(#INPUT.WF-AWARD-ID,1,9) NOT = ##STUDENT-ID OR
*S** SUBSTRING(#INPUT.WF-AWARD-ID,10,9) NOT = ##FUND-ID OR
*S** #INPUT.WF-FAO NOT = ##FAO-ID
*S** PERFORM REQUIRED-FIELD-CHECK REQUIRED-FIELD(*)
*S** PERFORM SET-KEYS
*S** RESET INITIAL #BEGIN-KEY
*S** MOVE BY NAME #BEGIN-KEY TO #INPUT.#KY
*S** /*
*S** ASSIGN #INPUT.WW-RECORD-TYPE = AWARD-TYPE
*S** COMPRESS ##STUDENT-ID ##FUND-ID INTO
*S** #INPUT.WF-AWARD-ID LEAVING NO
*S** ASSIGN #INPUT.WF-AID-YEAR = ##AID-YEAR
*S** ASSIGN #INPUT.WF-FAO = ##FAO-ID
*S** MOVE BY NAME #INPUT TO #END-KEY
*S** MOVE BY NAME #INPUT TO #BEGIN-KEY
*S** MOVE LO-TIME TO #BEGIN-KEY.WW-CTIME
*S** MOVE HI-TIME TO #END-KEY.WW-CTIME
*S** RESET #ARRAYS
*S** MOVE NON-DISPLAY-PROT-ATTR TO #TAB-AUD-CV(*)
*S** ASSIGN #LOW-KY = #BEGIN-KEY-RED
*S** ASSIGN #FORWARD = TRUE
*S** ASSIGN #FIRST-INPUT = TRUE
*S** END-IF
*S** ASSIGN #INSIDE-READ-LOOP = FALSE
*S***
*S**NEW-READ.
*S** REPEAT /* Escape this repeat if no end of data processing.
*S** /*
*S** /* If we are scrolling backwards then obtain our starting
*S** /* value from the table if one exists. If the table does not yet
*S** /* contain a starting value the currently specified input value will
*S** /* be used.
*S** IF #FORWARD AND #FIRST-INPUT /* Use input values.
*S** ASSIGN #START.#KY = #INPUT.WW-AUDIT-KEY
*S** ASSIGN #MATCH-FOUND = TRUE
*S** ELSE /* Use table values.
*S** IF #FORWARD AND NOT #BYPASS-READ
*S** ASSIGN #START.#KY = #HIGH-KY
*S** ASSIGN #MATCH-FOUND = TRUE
*S** ELSE
*S** ASSIGN #START.#KY = #LOW-KY /* Match this key.
*S** RESET #MATCH-FOUND #FIRST-KEY-FOUND
*S** END-IF
*S** END-IF
*S** /*
*S** /* Very first time trigger a new page to input starting value.
*S** IF #FIRST-INPUT THEN
*S** RESET #SEL-TBL(*)
*S** END-IF
*S***
*S** ASSIGN #SEL-INDX = 1
*S** RESET #END-OF-DATA
*S** ASSIGN WWAOBJ.#FUNCTION = 'NEXT'
*S** ASSIGN WWAUDTWD-ID = #START.#KY
*S** IF #BYPASS-READ
*S** RESET #BYPASS-READ
*S** COMPUTE WWAUDTWD-ID.WW-CTIME = WWAUDTWD-ID.WW-CTIME -
*S** T'00:00:01'
*S** END-IF
*S** MOVE BY NAME WWAUDTWD-ID.STRUCTURE TO WWAUDTWD
*S***
*S**READ-FILE. /* Escape this label if end of data processing is needed.
*S** REPEAT
*S***
*S** IF #FORWARD
*S** PERFORM CALL-OBJECT
*S** IF WWAUDTWD-ID > #END-KEY-RED OR
*S** NOT WWAOBJ.#EXISTS
*S** ASSIGN #END-DATA-FORWARD = TRUE
*S*** WRITE NOTITLE ' '
*S*** NEWPAGE
*S** ESCAPE BOTTOM(READ-FILE.) IMMEDIATE
*S** END-IF
*S** END-IF
*S** ASSIGN #INSIDE-READ-LOOP = TRUE
*S** RESET #END-DATA-FORWARD
*S** #END-DATA-REVERSE
*S** IF #FIRST-INPUT
*S** RESET #FIRST-INPUT
*S** END-IF
*S** /*
*S** /* Assign #KEY to equal the descriptor utilized.
*S** ASSIGN #KEY = WWAUDTWD-ID
*S** /*
*S** IF #SEL-INDX = 1
*S** RESET #ARRAYS #LAST-DATE #LAST-USER
*S** ##MSG ##MSG-DATA(*) ##RETURN-CODE
*S** MOVE NON-DISPLAY-PROT-ATTR TO #TAB-AUD-CV(*)
*S** END-IF
*S** /*
*S** IF #FORWARD
*S** IF #SEL-INDX = 1
*S** ASSIGN #LOW-KY = WWAUDTWD-ID
*S** ASSIGN #HIGH-KY = WWAUDTWD-ID
*S** ELSE
*S** ASSIGN #HIGH-KY = WWAUDTWD-ID
*S** END-IF
*S** END-IF
*S** /*
*S** IF #SEL-INDX NOT > #MAX-ARRAY-ENTR
*S** IF #FORWARD
*S** IF WWAUDTWD.WW-CDATE NOT = #LAST-DATE
*S** IF #SEL-INDX > 1 AND
*S** #SEL-INDX < #MAX-ARRAY-ENTR
*S*** ADD 1 TO #SEL-INDX /* Blank line on new dates
*S** IGNORE
*S** ELSE
*S** IF #SEL-INDX = #MAX-ARRAY-ENTR
*S** ASSIGN #SUB = #MAX-ARRAY-ENTR - 1
*S** ASSIGN #HIGH-KY = #SEL-TBL.#KY(#SUB)
*S** END-IF
*S** END-IF
*S** RESET #LAST-USER
*S** MOVE EDITED WWAUDTWD.WW-CDATE(EM=MM/DD/YYYY) TO
*S** #ARRAY-DATE(#SEL-INDX)
*S** MOVE WWAUDTWD.WW-CDATE TO #LAST-DATE
*S** END-IF
*S** IF WWAUDTWD.WW-USER-ID NOT = #LAST-USER
*S** MOVE WWAUDTWD.WW-USER-ID TO #ARRAY-USER(#SEL-INDX)
*S** #LAST-USER
*S** RESET #LAST-FILE
*S** END-IF
*S*** IF WWAUDTWD.WW-CH-FILE NOT = #LAST-FILE
*S*** MOVE WWAUDTWD.WW-CH-FILE TO #ARRAY-FILE(#SEL-INDX)
*S*** #LAST-FILE
*S*** #PDA-FILE-NAME
*S*** PERFORM TRANSLATE-PDA-NAME
*S*** MOVE #PDA-FILE-NAME TO #ARRAY-FILE-NAME(#SEL-INDX)
*S*** END-IF
*S** MOVE WWAUDTWD.WF-AT-AC TO #ARRAY-AC(#SEL-INDX)
*S** IF WWAUDTWD.WF-AT-AMT NE 0
*S** MOVE EDITED WWAUDTWD.WF-AT-AMT(EM=ZZ,ZZ9.99-) TO
*S** #ARRAY-AMT(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-AC = 'O ' OR = 'OI' OR = 'B ' OR = 'BI'
*S** OR = 'A ' OR = 'C ' OR = 'R ' OR = 'D '
*S** MOVE WWAUDTWD.WF-AT-DIST TO #ARRAY-DIST(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-OFF > 0
*S** MOVE EDITED WWAUDTWD.WF-AT-OFF(EM=ZZ,ZZ9.99) TO
*S** #ARRAY-OFF(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-ACC > 0
*S** MOVE EDITED WWAUDTWD.WF-AT-ACC(EM=ZZ,ZZ9.99) TO
*S** #ARRAY-ACC(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-DIS > 0
*S** MOVE EDITED WWAUDTWD.WF-AT-DIS(EM=ZZ,ZZ9.99) TO
*S** #ARRAY-DIS(#SEL-INDX)
*S** END-IF
*S** MOVE NON-DISPLAY-ATTR TO #TAB-AUD-CV(#SEL-INDX)
*S** ASSIGN #SEL-TBL.#KY(#SEL-INDX) = #KEY
*S** END-IF
*S** ADD 1 TO #SEL-INDX
*S** END-IF
*S** IF #SEL-INDX > #MAX-ARRAY-ENTR
*S** WRITE NOTITLE ' '
*S** NEWPAGE
*S** END-IF
*S** /*
*S** /* Display headings and load the scrolling table with key and
*S** /* Unique record identifier for backward/sideways scrolling.
*S** AT TOP OF PAGE
*S** ASSIGN #TOP-OF-PAGE = TRUE
*S** ASSIGN #SEL-INDX = 1
*S** /*
*S** END-TOPPAGE
*S** /*
*S** /* Input the screen and check users PF keys.
*S** AT END OF PAGE
*S** /*
*S** /* Calculate last line number before the input fields.
*S*** IF ##MSG = ' ' AND #SEL-TBL.#KY(*) NE #NULL-KEY THEN
*S*** MOVE 'ENTER date to position'
*S*** TO ##MSG
*S*** END-IF
*S** /*
*S** INPUT WITH TEXT ##MSG,
*S** ##MSG-DATA(1),##MSG-DATA(2),##MSG-DATA(3)
*S** USING MAP 'WFAUDAWM'
*S** /*
*S** INCLUDE WWSTDCHK /* Check standard pf-keys or '.' if first pos.
*S** IF *PF-KEY = WWKEYLDA.#SELECT-KEY
*S** ASSIGN #STD-KEY-PRESSED = TRUE
*S** END-IF
*S** IF #STD-KEY-PRESSED THEN
*S** ASSIGN #FORWARD = FALSE
*S** PERFORM EXIT-READ-LOOP
*S** END-IF
*S** /*
*S** /* Check scroll keys.
*S** DECIDE ON FIRST *PF-KEY
*S** VALUE WWKEYLDA.#LEFT-KEY /* Scroll left
*S** REINPUT 'Screen has only one horizontal panel' ALARM
*S** VALUE WWKEYLDA.#RIGHT-KEY /* Scroll right
*S** REINPUT 'Screen has only one horizontal panel' ALARM
*S** ANY
*S** ASSIGN #FORWARD = FALSE
*S** PERFORM EXIT-READ-LOOP
*S** NONE
*S** IF NOT(*PF-KEY = 'ENTR' OR
*S** = WWKEYLDA.#FORWARD-KEY OR
*S** = WWKEYLDA.#EXPAND-KEY OR
*S** = WWKEYLDA.#NOTEPAD-KEY OR
*S** = WWKEYLDA.#SELECT-KEY) THEN
*S** REINPUT 'Invalid program function key' ALARM
*S** END-IF
*S** ASSIGN #FORWARD = TRUE
*S** /*
*S** /* Determine key to pass if EXPAND key pressed
*S** IF *PF-KEY = WWKEYLDA.#EXPAND-KEY
*S** FOR #SUB = 1 TO #MAX-ARRAY-ENTR
*S** IF *CURS-FIELD = POS(#TAB-AUD(#SUB))
*S** ASSIGN #SELECTED-KEY = #SEL-TBL.#KY(#SUB)
*S** PERFORM EXIT-READ-LOOP
*S** END-IF
*S** END-FOR
*S** END-IF
*S** IF #END-DATA-FORWARD AND CDATE-CV NOT MODIFIED
*S** REINPUT 'Bottom of current list' ALARM
*S** END-IF
*S** END-DECIDE
*S** /*
*S** /* Check whether the user changed (overtyped) the input values.
*S** DECIDE FOR FIRST CONDITION
*S** WHEN CDATE-CV MODIFIED /* Key was modified
*S** /* start new read.
*S** ASSIGN #FORWARD = TRUE
*S** /*
*S** /* If the user entered a value which is on the current
*S** /* screen then assume selection.
*S** ASSIGN #FILE-FIELD = 'WWAUDTWS.WW-CDATE'
*S** ASSIGN #VALUE = WWAUDTWS.WW-CDATE
*S** ASSIGN #FIELD-POS = POS(WWAUDTWS.WW-CDATE)
*S** ASSIGN #EDIT-MASK = 'MM/DD/YYYY'
*S** PERFORM CALL-EDITOR WWVALLDA
*S** IF NOT #VALID-VALUE OR NOT #VALID-MASK
*S** ASSIGN CDATE-F = TRUE
*S** MOVE HI-LITE-ATTR TO CDATE-CV
*S** REINPUT 'Invalid date, re-enter' ALARM
*S** ELSE
*S** MOVE NORMAL-ATTR TO CDATE-CV
*S** RESET INITIAL CDATE-F
*S** ASSIGN WWAUDTWS.WW-CDATE = #VALUE
*S** END-IF
*S** MOVE EDITED WWAUDTWS.WW-CDATE TO
*S** #INPUT.WW-CTIME (EM=MMDDYYYY)
*S** RESET WWAUDTWS.WW-CDATE
*S** ASSIGN #FIRST-INPUT = TRUE
*S** WHEN ANY
*S** PERFORM EXIT-READ-LOOP
*S** WHEN NONE
*S** RESET #ARRAY-DATE(*) #ARRAY-AC(*) #ARRAY-AMT(*)
*S** #ARRAY-OFF(*) #ARRAY-ACC(*) #ARRAY-DIS(*)
*S** #ARRAY-DIST(*) #ARRAY-USER(*)
*S** END-DECIDE
*S** END-ENDPAGE /* AT END OF PAGE
*S** END-REPEAT /* Find of file prime file.
*S** /*
*S** ASSIGN #INSIDE-READ-LOOP = FALSE
*S** ASSIGN #END-OF-DATA = TRUE
*S** /*
*S** /* Determine whether the 'End of Data' line is the only line written
*S** /* to the screen. If so, don't decrement #SCROLL-INDX for PF7.
*S** /* If Date was modified and already passed entries,
*S** /* set date to allow backward scrolling
*S** IF #FIRST-INPUT
*S** MOVE HI-TIME TO #INPUT.WW-CTIME
*S** ASSIGN #FIRST-INPUT = TRUE
*S** RESET #END-OF-DATA
*S** END-IF
*S** WRITE NOTITLE ' '
*S** NEWPAGE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE EXIT-READ-LOOP
*S*************************************************************************
*S***
*S** ESCAPE BOTTOM(NEW-READ.) IMMEDIATE
*S**END-SUBROUTINE /* EXIT-READ-LOOP
*S***
*S** END-REPEAT /* NEW-READ.
*S** IF #STD-KEY-PRESSED THEN
*S** RESET #STD-KEY-PRESSED
*S** IF *PF-KEY = WWKEYLDA.#FLIP-KEY
*S** ASSIGN #FORWARD = TRUE
*S** ASSIGN #BYPASS-READ = TRUE
*S** END-IF
*S** INCLUDE WWSTDKEY /* Check standard pf-keys or '.' if first pos.
*S** END-IF
*S** /*
*S** /* If a record was selected process the record and reposition.
*S** IF #SELECTED-KEY NE #NULL-KEY THEN
*S** ASSIGN #INPUT.WW-CTIME = INIT-DATE
*S***
*S*** Processing to be performed after a record has been selected.
*S** IF *PF-KEY = WWKEYLDA.#EXPAND-KEY
*S** /*
*S** /* Process #SELECTED-KEY record here.
*S** MOVE #SELECTED-KEY TO ##PASS-KEY
*S** FETCH RETURN 'WFAUDADP'
*S** RESET ##PASS-KEY
*S** ASSIGN #BYPASS-READ = TRUE
*S** ELSE
*S** IGNORE
*S** END-IF
*S** END-IF
*S***
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CALL-OBJECT
*S*************************************************************************
*S***
*S*** Call WW-AUDIT Object subprogram (forward key)
*S** CALLNAT 'WWAUDTWO' WW-GDA
*S** WWAUDTWD
*S** WWAUDTWD-ID
*S** WWAUDTWR
*S** WWAOBJ
*S**END-SUBROUTINE /* CALL-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE FINAL-PROCESSING
*S*************************************************************************
*S***
*S** INCLUDE WWEND /* Restore environment.
*S** RESET ##PASS-TEMP
*S**END-SUBROUTINE /* FINAL-PROCESSING
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE INITIALIZATIONS
*S*************************************************************************
*S***
*S** INCLUDE WWBEGIN /* Capture environment.
*S** SET CONTROL 'WBM'
*S***
*S*** Required Fields
*S** MOVE '##SID' TO REQUIRED-FIELD(1)
*S** MOVE '##FAO-ID' TO REQUIRED-FIELD(2)
*S** MOVE '##AID-YEAR' TO REQUIRED-FIELD(3)
*S** MOVE '##FUND-ID' TO REQUIRED-FIELD(4)
*S***
*S*** Specify which PF-KEYS are valid by using RESET INITIAL.
*S** INCLUDE WWPFSTD /* Standard PF-Keys
*S*** INCLUDE WWPFUD /* Scroll up-down keys
*S** RESET INITIAL WWKEYLDA.#SELECT-KEY
*S** WWKEYLDA.#NOTEPAD-KEY
*S** WWKEYLDA.#FORWARD-KEY
*S** WWKEYLDA.#EXPAND-KEY
*S***
*S** MOVE NORMAL-ATTR TO CDATE-CV
*S**END-SUBROUTINE /* INITIALIZATIONS
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE RESET-ARRAY-INDX
*S*************************************************************************
*S***
*S*** Move array 'up' one occurrence.
*S*** (Date changed with no room for break.)
*S** ASSIGN #CNT = #MAX-ARRAY-ENTR - 1
*S** FOR #SUB = 1 TO #CNT
*S** ASSIGN #ARRAY-DATE(#SUB) = #ARRAY-DATE(#SUB+1)
*S** ASSIGN #ARRAY-USER(#SUB) = #ARRAY-USER(#SUB+1)
*S** END-FOR
*S** RESET #ARRAY-DATE(#MAX-ARRAY-ENTR)
*S** #ARRAY-USER(#MAX-ARRAY-ENTR)
*S** /*
*S** ASSIGN #LOW-KY = #SEL-TBL.#KY(#CNT)
*S**END-SUBROUTINE /* RESET-ARRAY-INDX
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE SET-KEYS
*S*************************************************************************
*S***
*S** INCLUDE WWSETKEY /* Set specified keys.
*S** INCLUDE WWSETHLP /* Set PFN=Help
*S**END-SUBROUTINE /* SET-KEYS
*S***
*S**END-REPEAT /* PROG.
*S**PERFORM FINAL-PROCESSING
*S**END
C:\Documents and Settings\Dan\My Documents\share\FINANCIER\releases\Natural\1210-99\new\wfaudawp.txt
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
536
537
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Program : WFAUDAWP
*S*** System : FINANCIER
*S*** Title : Award audit program
*S*** Function : This program displays a student's award audit history.
*S***
*S*** Copyright 1995 - 2011 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S***
*S** LOCAL USING WWAUDTWD /* Passed to Object Subprogram WWAUDTWO
*S** LOCAL USING WWAUDTWR /* Passed to Object Subprogram WWAUDTWO
*S** LOCAL USING WWAUDTWS /* Shadow file PDA
*S** LOCAL USING WWAOBJ /* Passed to Object Subprograms
*S***
*S** LOCAL USING WWCONST /* Constants LDA
*S** LOCAL USING WWDIALDA /* Local data for dialog objects.
*S** LOCAL USING WWENVIRA /* Used to capture/restore previous environment.
*S** LOCAL USING WWKEYLDA /* Used to set function keys + their alias.
*S** LOCAL USING WWVALLDA /* Valid value LDA
*S***
*S** LOCAL
*S***
*S*** Constants.
*S** 01 #MAX-PAGES(P3) CONST<2> /* Maximum scroll pages.
*S** 01 #MAX-ARRAY-ENTR(P3) CONST<13> /* Maximum array entries.
*S** 01 #UNCONDITIONALLY(L) CONST<TRUE> /* Used to REJECT always.
*S***
*S*** Miscellaneous variables.
*S** 01 #CURS-LINE(P5) /* Cursor select line.
*S** 01 #END-OF-DATA(L) /* End of logical read.
*S** 01 #END-OF-PAGE-LINE(P5) /* Line number where EOP starts.
*S** 01 #FIRST
*S** 02 #KY(A32) /* 1st KEY when looking for match.
*S** 01 #FIRST-INPUT(L) INIT<TRUE> /* Trigger End of Page.
*S** 01 #FIRST-KEY-FOUND(L) /* First unique value found.
*S** 01 #FIRST-TIME-REV(L) /* First reverse.
*S** 01 #FORWARD(L) INIT<TRUE> /* Not backwards left or right.
*S** 01 #BYPASS-READ(L) /* No paging
*S** 01 #SUB(P3)
*S** 01 #CNT(P3)
*S** 01 #NEXT(L)
*S** /*
*S** /* Variables utilized by Requirement routine
*S** 01 #REQMNTS(3)
*S** 02 #REQMNT-TYPE(A1) /* (A/Application, D/Disbursement)
*S** INIT (1)<' '> (2)<' '> (3)<' '>
*S** 02 #REQMNT-DOC(A6) /* Document mnemonic
*S** INIT (1)<' '> (2)<' '> (3)<' '>
*S** 02 #REQMNT-PD(A2) /* (ST/Student, AY/Aid Year)
*S** INIT (1)<' '> (2)<' '> (3)<' '>
*S** /*
*S** /* Define input fields.
*S** 01 #INPUT
*S** 02 #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WF-AID-YEAR(A4)
*S** 03 WF-FAO(A2)
*S** 03 WF-AWARD-ID(A18)
*S** 03 WW-CTIME(T)
*S** 02 REDEFINE #KY
*S** 03 WW-AUDIT-KEY(A32) /* Input key value.
*S** 01 #END-KEY /* End of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WF-AID-YEAR(A4)
*S** 02 WF-FAO(A2)
*S** 02 WF-AWARD-ID(A18)
*S** 02 WW-CTIME(T)
*S** 01 REDEFINE #END-KEY
*S** 02 #END-KEY-RED(A32)
*S** 01 #BEGIN-KEY /* Beginning of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WF-AID-YEAR(A4)
*S** 02 WF-FAO(A2)
*S** 02 WF-AWARD-ID(A18)
*S** 02 WW-CTIME(T)
*S** 01 REDEFINE #BEGIN-KEY
*S** 02 #BEGIN-KEY-RED(A32)
*S***
*S** 01 #INSIDE-READ-LOOP(L) /* Executing statement inside read.
*S***
*S*** Value of the scroll key on current record
*S** 01 #KEY(A32) /* Key field of record.
*S** 01 #MATCH-FOUND(L) /* Matched Unique Id from table.
*S** 01 #NR-HEAD-LINES(P3) INIT<3> /* 2 headings + Skip.
*S** 01 #NULL-KEY(A32) /* Empty key value.
*S** 01 #PANEL(P3) INIT<1> /* Left/Right panel number.
*S** 01 #SCR-CV(C) INIT<(AD=I)> /* Determine if any field modified.
*S***
*S*** Tables for backward/sideways scrolling feature
*S*** 01 #SCROLL-TBL(1:12)
*S*** 02 #KY(A22) /* Store top key/page.
*S*** 02 #REV-DATE(D)
*S*** 02 #REV-TIME(T)
*S** 01 #SEL-INDX(P5) /* Select table index.
*S** 01 #SEL-TBL(1:#MAX-ARRAY-ENTR) /* Selection table
*S** 02 #KY(A32)
*S** 02 REDEFINE #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WF-AID-YEAR(A4)
*S** 03 WF-FAO(A2)
*S** 03 WF-AWARD-ID(A18)
*S** 03 WW-CTIME(T)
*S** 01 #SELECTED-KEY(A32) /* Key of selected record.
*S** 01 #DISPLAYED-KEY(A1) /* Required for WWSTDKEY LDA
*S***
*S*** Key value for starting position of read.
*S** 01 #START
*S** 02 #KY(A32)
*S** 01 #STD-KEY-PRESSED(L) /* Quit, Return, Flip, Main.
*S** 01 #TOP-OF-PAGE(L) /* Top of Page was triggered.
*S** 01 #END-DATA-REVERSE(L)
*S** 01 #END-DATA-FORWARD(L)
*S***
*S** 01 #LOW-KY(A32)
*S** 01 #HIGH-KY(A32)
*S***
*S** 01 #ARRAYS /* Array of multiple records
*S** 02 #ARRAY-DATE(A10/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-AC(A2/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-AMT(A10/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-OFF(A9/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-ACC(A9/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-DIS(A9/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-DIST(A1/1:#MAX-ARRAY-ENTR)
*S** 02 #ARRAY-USER(A8/1:#MAX-ARRAY-ENTR)
*S** 02 #TAB-AUD(A1/1:#MAX-ARRAY-ENTR)
*S** 02 #TAB-AUD-CV(C/1:#MAX-ARRAY-ENTR)
*S** 01 #HOLD-FIELDS
*S** 02 #LAST-FILE(A8)
*S** 02 #LAST-USER(A8)
*S** 02 #LAST-DATE(D)
*S** 01 #BYPASS-INPUT (L) /* Bypass
*S**END-DEFINE
*S***
*S**FORMAT ES=ON /* ES suppresses (WRITE ' ') output,
*S** /* needed for newpage processing
*S**PERFORM INITIALIZATIONS
*S***
*S**PROG.
*S**REPEAT /* Repeat loop to allow escape of program from within subroutine.
*S***
*S*************************************************************************
*S***
*S** IF #SELECTED-KEY = SPACE
*S** RESET #INPUT.WW-AUDIT-KEY
*S** END-IF
*S** IF SUBSTRING(#INPUT.WF-AWARD-ID,1,9) NOT = ##STUDENT-ID OR
*S** SUBSTRING(#INPUT.WF-AWARD-ID,10,9) NOT = ##FUND-ID OR
*S** #INPUT.WF-FAO NOT = ##FAO-ID
*S** PERFORM REQUIRED-FIELD-CHECK REQUIRED-FIELD(*)
*S** PERFORM SET-KEYS
*S** RESET INITIAL #BEGIN-KEY
*S** MOVE BY NAME #BEGIN-KEY TO #INPUT.#KY
*S** /*
*S** ASSIGN #INPUT.WW-RECORD-TYPE = AWARD-TYPE
*S** COMPRESS ##STUDENT-ID ##FUND-ID INTO
*S** #INPUT.WF-AWARD-ID LEAVING NO
*S** ASSIGN #INPUT.WF-AID-YEAR = ##AID-YEAR
*S** ASSIGN #INPUT.WF-FAO = ##FAO-ID
*S** MOVE BY NAME #INPUT TO #END-KEY
*S** MOVE BY NAME #INPUT TO #BEGIN-KEY
*S** MOVE LO-TIME TO #BEGIN-KEY.WW-CTIME
*S** MOVE HI-TIME TO #END-KEY.WW-CTIME
*S** RESET #ARRAYS
*S** MOVE NON-DISPLAY-PROT-ATTR TO #TAB-AUD-CV(*)
*S** ASSIGN #LOW-KY = #BEGIN-KEY-RED
*S** ASSIGN #FORWARD = TRUE
*S** ASSIGN #FIRST-INPUT = TRUE
*S** END-IF
*S** ASSIGN #INSIDE-READ-LOOP = FALSE
*S***
*S**NEW-READ.
*S** REPEAT /* Escape this repeat if no end of data processing.
*S** /*
*S** /* If we are scrolling backwards then obtain our starting
*S** /* value from the table if one exists. If the table does not yet
*S** /* contain a starting value the currently specified input value will
*S** /* be used.
*S** IF #FORWARD AND #FIRST-INPUT /* Use input values.
*S** ASSIGN #START.#KY = #INPUT.WW-AUDIT-KEY
*S** ASSIGN #MATCH-FOUND = TRUE
*S** ELSE /* Use table values.
*S** IF #FORWARD AND NOT #BYPASS-READ
*S** ASSIGN #START.#KY = #HIGH-KY
*S** ASSIGN #MATCH-FOUND = TRUE
*S** ELSE
*S** ASSIGN #START.#KY = #LOW-KY /* Match this key.
*S** RESET #MATCH-FOUND #FIRST-KEY-FOUND
*S** END-IF
*S** END-IF
*S** /*
*S** /* Very first time trigger a new page to input starting value.
*S** IF #FIRST-INPUT THEN
*S** RESET #SEL-TBL(*)
*S** END-IF
*S***
*S** ASSIGN #SEL-INDX = 1
*S** RESET #END-OF-DATA
*S** ASSIGN WWAOBJ.#FUNCTION = 'NEXT'
*S** ASSIGN WWAUDTWD-ID = #START.#KY
*S** IF #BYPASS-READ
*S** RESET #BYPASS-READ
*S** COMPUTE WWAUDTWD-ID.WW-CTIME = WWAUDTWD-ID.WW-CTIME -
*S** T'00:00:01'
*S** END-IF
*S** MOVE BY NAME WWAUDTWD-ID.STRUCTURE TO WWAUDTWD
*S***
*S**READ-FILE. /* Escape this label if end of data processing is needed.
*S** REPEAT
*S***
*S** IF #FORWARD
*S** PERFORM CALL-OBJECT
*S** IF WWAUDTWD-ID > #END-KEY-RED OR
*S** NOT WWAOBJ.#EXISTS
*S** ASSIGN #END-DATA-FORWARD = TRUE
*S*** WRITE NOTITLE ' '
*S*** NEWPAGE
*S** ESCAPE BOTTOM(READ-FILE.) IMMEDIATE
*S** END-IF
*S** END-IF
*S** ASSIGN #INSIDE-READ-LOOP = TRUE
*S** RESET #END-DATA-FORWARD
*S** #END-DATA-REVERSE
*S** IF #FIRST-INPUT
*S** RESET #FIRST-INPUT
*S** END-IF
*S** /*
*S** /* Assign #KEY to equal the descriptor utilized.
*S** ASSIGN #KEY = WWAUDTWD-ID
*S** /*
*S** IF #SEL-INDX = 1
*S** RESET #ARRAYS #LAST-DATE #LAST-USER
*S** ##MSG ##MSG-DATA(*) ##RETURN-CODE
*S** MOVE NON-DISPLAY-PROT-ATTR TO #TAB-AUD-CV(*)
*S** END-IF
*S** /*
*S** IF #FORWARD
*S** IF #SEL-INDX = 1
*S** ASSIGN #LOW-KY = WWAUDTWD-ID
*S** ASSIGN #HIGH-KY = WWAUDTWD-ID
*S** ELSE
*S** ASSIGN #HIGH-KY = WWAUDTWD-ID
*S** END-IF
*S** END-IF
*S** /*
*S** IF #SEL-INDX NOT > #MAX-ARRAY-ENTR
*S** IF #FORWARD
*S** IF WWAUDTWD.WW-CDATE NOT = #LAST-DATE
*S** IF #SEL-INDX > 1 AND
*S** #SEL-INDX < #MAX-ARRAY-ENTR
*S*** ADD 1 TO #SEL-INDX /* Blank line on new dates
*S** IGNORE
*S** ELSE
*S** IF #SEL-INDX = #MAX-ARRAY-ENTR
*S** ASSIGN #SUB = #MAX-ARRAY-ENTR - 1
*S** ASSIGN #HIGH-KY = #SEL-TBL.#KY(#SUB)
*S** END-IF
*S** END-IF
*S** RESET #LAST-USER
*S** MOVE EDITED WWAUDTWD.WW-CDATE(EM=MM/DD/YYYY) TO
*S** #ARRAY-DATE(#SEL-INDX)
*S** MOVE WWAUDTWD.WW-CDATE TO #LAST-DATE
*S** END-IF
*S** IF WWAUDTWD.WW-USER-ID NOT = #LAST-USER
*S** MOVE WWAUDTWD.WW-USER-ID TO #ARRAY-USER(#SEL-INDX)
*S** #LAST-USER
*S** RESET #LAST-FILE
*S** END-IF
*S*** IF WWAUDTWD.WW-CH-FILE NOT = #LAST-FILE
*S*** MOVE WWAUDTWD.WW-CH-FILE TO #ARRAY-FILE(#SEL-INDX)
*S*** #LAST-FILE
*S*** #PDA-FILE-NAME
*S*** PERFORM TRANSLATE-PDA-NAME
*S*** MOVE #PDA-FILE-NAME TO #ARRAY-FILE-NAME(#SEL-INDX)
*S*** END-IF
*S** MOVE WWAUDTWD.WF-AT-AC TO #ARRAY-AC(#SEL-INDX)
*S** IF WWAUDTWD.WF-AT-AMT NE 0
*S** MOVE EDITED WWAUDTWD.WF-AT-AMT(EM=ZZ,ZZ9.99-) TO
*S** #ARRAY-AMT(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-AC = 'O ' OR = 'OI' OR = 'B ' OR = 'BI'
*S** OR = 'A ' OR = 'C ' OR = 'R ' OR = 'D '
*S** MOVE WWAUDTWD.WF-AT-DIST TO #ARRAY-DIST(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-OFF > 0
*S** MOVE EDITED WWAUDTWD.WF-AT-OFF(EM=ZZ,ZZ9.99) TO
*S** #ARRAY-OFF(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-ACC > 0
*S** MOVE EDITED WWAUDTWD.WF-AT-ACC(EM=ZZ,ZZ9.99) TO
*S** #ARRAY-ACC(#SEL-INDX)
*S** END-IF
*S** IF WWAUDTWD.WF-AT-DIS > 0
*S** MOVE EDITED WWAUDTWD.WF-AT-DIS(EM=ZZ,ZZ9.99) TO
*S** #ARRAY-DIS(#SEL-INDX)
*S** END-IF
*S** MOVE NON-DISPLAY-ATTR TO #TAB-AUD-CV(#SEL-INDX)
*S** ASSIGN #SEL-TBL.#KY(#SEL-INDX) = #KEY
*S** END-IF
*S** ADD 1 TO #SEL-INDX
*S** END-IF
*S** IF #SEL-INDX > #MAX-ARRAY-ENTR
*S** NEWPAGE EVEN IF TOP OF PAGE
*S** END-IF
*S** /*
*S** /* Display headings and load the scrolling table with key and
*S** /* Unique record identifier for backward/sideways scrolling.
*S** AT TOP OF PAGE
*S** ASSIGN #TOP-OF-PAGE = TRUE
*S** ASSIGN #SEL-INDX = 1
*S** /*
*S** END-TOPPAGE
*S** /*
*S** /* Input the screen and check users PF keys.
*S** AT END OF PAGE
*S** /*
*S** /* Calculate last line number before the input fields.
*S*** IF ##MSG = ' ' AND #SEL-TBL.#KY(*) NE #NULL-KEY THEN
*S*** MOVE 'ENTER date to position'
*S*** TO ##MSG
*S*** END-IF
*S** /*
*S** INPUT WITH TEXT ##MSG,
*S** ##MSG-DATA(1),##MSG-DATA(2),##MSG-DATA(3)
*S** USING MAP 'WFAUDAWM'
*S** /*
*S** INCLUDE WWSTDCHK /* Check standard pf-keys or '.' if first pos.
*S** IF *PF-KEY = WWKEYLDA.#SELECT-KEY
*S** ASSIGN #STD-KEY-PRESSED = TRUE
*S** END-IF
*S** IF #STD-KEY-PRESSED THEN
*S** ASSIGN #FORWARD = FALSE
*S** PERFORM EXIT-READ-LOOP
*S** END-IF
*S** /*
*S** /* Check scroll keys.
*S** DECIDE ON FIRST *PF-KEY
*S** VALUE WWKEYLDA.#LEFT-KEY /* Scroll left
*S** REINPUT 'Screen has only one horizontal panel' ALARM
*S** VALUE WWKEYLDA.#RIGHT-KEY /* Scroll right
*S** REINPUT 'Screen has only one horizontal panel' ALARM
*S** ANY
*S** ASSIGN #FORWARD = FALSE
*S** PERFORM EXIT-READ-LOOP
*S** NONE
*S** IF NOT(*PF-KEY = 'ENTR' OR
*S** = WWKEYLDA.#FORWARD-KEY OR
*S** = WWKEYLDA.#EXPAND-KEY OR
*S** = WWKEYLDA.#NOTEPAD-KEY OR
*S** = WWKEYLDA.#SELECT-KEY) THEN
*S** REINPUT 'Invalid program function key' ALARM
*S** END-IF
*S** ASSIGN #FORWARD = TRUE
*S** /*
*S** /* Determine key to pass if EXPAND key pressed
*S** IF *PF-KEY = WWKEYLDA.#EXPAND-KEY
*S** FOR #SUB = 1 TO #MAX-ARRAY-ENTR
*S** IF *CURS-FIELD = POS(#TAB-AUD(#SUB))
*S** ASSIGN #SELECTED-KEY = #SEL-TBL.#KY(#SUB)
*S** PERFORM EXIT-READ-LOOP
*S** END-IF
*S** END-FOR
*S** END-IF
*S** IF #END-DATA-FORWARD AND CDATE-CV NOT MODIFIED
*S** REINPUT 'Bottom of current list' ALARM
*S** END-IF
*S** END-DECIDE
*S** /*
*S** /* Check whether the user changed (overtyped) the input values.
*S** DECIDE FOR FIRST CONDITION
*S** WHEN CDATE-CV MODIFIED /* Key was modified
*S** /* start new read.
*S** ASSIGN #FORWARD = TRUE
*S** /*
*S** /* If the user entered a value which is on the current
*S** /* screen then assume selection.
*S** ASSIGN #FILE-FIELD = 'WWAUDTWS.WW-CDATE'
*S** ASSIGN #VALUE = WWAUDTWS.WW-CDATE
*S** ASSIGN #FIELD-POS = POS(WWAUDTWS.WW-CDATE)
*S** ASSIGN #EDIT-MASK = 'MM/DD/YYYY'
*S** PERFORM CALL-EDITOR WWVALLDA
*S** IF NOT #VALID-VALUE OR NOT #VALID-MASK
*S** ASSIGN CDATE-F = TRUE
*S** MOVE HI-LITE-ATTR TO CDATE-CV
*S** REINPUT 'Invalid date, re-enter' ALARM
*S** ELSE
*S** MOVE NORMAL-ATTR TO CDATE-CV
*S** RESET INITIAL CDATE-F
*S** ASSIGN WWAUDTWS.WW-CDATE = #VALUE
*S** END-IF
*S** MOVE EDITED WWAUDTWS.WW-CDATE TO
*S** #INPUT.WW-CTIME (EM=MMDDYYYY)
*S** RESET WWAUDTWS.WW-CDATE
*S** ASSIGN #FIRST-INPUT = TRUE
*S** WHEN ANY
*S** PERFORM EXIT-READ-LOOP
*S** WHEN NONE
*S** RESET #ARRAY-DATE(*) #ARRAY-AC(*) #ARRAY-AMT(*)
*S** #ARRAY-OFF(*) #ARRAY-ACC(*) #ARRAY-DIS(*)
*S** #ARRAY-DIST(*) #ARRAY-USER(*)
*S** END-DECIDE
*S** END-ENDPAGE /* AT END OF PAGE
*S** END-REPEAT /* Find of file prime file.
*S** /*
*S** ASSIGN #INSIDE-READ-LOOP = FALSE
*S** ASSIGN #END-OF-DATA = TRUE
*S** /*
*S** /* Determine whether the 'End of Data' line is the only line written
*S** /* to the screen. If so, don't decrement #SCROLL-INDX for PF7.
*S** /* If Date was modified and already passed entries,
*S** /* set date to allow backward scrolling
*S** IF #FIRST-INPUT
*S** MOVE HI-TIME TO #INPUT.WW-CTIME
*S** ASSIGN #FIRST-INPUT = TRUE
*S** RESET #END-OF-DATA
*S** END-IF
*S** IF #TOP-OF-PAGE
*S** NEWPAGE EVEN IF TOP OF PAGE
*S** ELSE
*S** WRITE NOTITLE ' '
*S** NEWPAGE
*S** END-IF
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE EXIT-READ-LOOP
*S*************************************************************************
*S***
*S** ESCAPE BOTTOM(NEW-READ.) IMMEDIATE
*S**END-SUBROUTINE /* EXIT-READ-LOOP
*S***
*S** END-REPEAT /* NEW-READ.
*S** IF #STD-KEY-PRESSED THEN
*S** RESET #STD-KEY-PRESSED
*S** IF *PF-KEY = WWKEYLDA.#FLIP-KEY
*S** ASSIGN #FORWARD = TRUE
*S** ASSIGN #BYPASS-READ = TRUE
*S** END-IF
*S** INCLUDE WWSTDKEY /* Check standard pf-keys or '.' if first pos.
*S** END-IF
*S** /*
*S** /* If a record was selected process the record and reposition.
*S** IF #SELECTED-KEY NE #NULL-KEY THEN
*S** ASSIGN #INPUT.WW-CTIME = INIT-DATE
*S***
*S*** Processing to be performed after a record has been selected.
*S** IF *PF-KEY = WWKEYLDA.#EXPAND-KEY
*S** /*
*S** /* Process #SELECTED-KEY record here.
*S** MOVE #SELECTED-KEY TO ##PASS-KEY
*S** FETCH RETURN 'WFAUDADP'
*S** RESET ##PASS-KEY
*S** ASSIGN #BYPASS-READ = TRUE
*S** ELSE
*S** IGNORE
*S** END-IF
*S** END-IF
*S***
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CALL-OBJECT
*S*************************************************************************
*S***
*S*** Call WW-AUDIT Object subprogram (forward key)
*S** CALLNAT 'WWAUDTWO' WW-GDA
*S** WWAUDTWD
*S** WWAUDTWD-ID
*S** WWAUDTWR
*S** WWAOBJ
*S**END-SUBROUTINE /* CALL-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE FINAL-PROCESSING
*S*************************************************************************
*S***
*S** INCLUDE WWEND /* Restore environment.
*S** RESET ##PASS-TEMP
*S**END-SUBROUTINE /* FINAL-PROCESSING
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE INITIALIZATIONS
*S*************************************************************************
*S***
*S** INCLUDE WWBEGIN /* Capture environment.
*S** SET CONTROL 'WBM'
*S***
*S*** Required Fields
*S** MOVE '##SID' TO REQUIRED-FIELD(1)
*S** MOVE '##FAO-ID' TO REQUIRED-FIELD(2)
*S** MOVE '##AID-YEAR' TO REQUIRED-FIELD(3)
*S** MOVE '##FUND-ID' TO REQUIRED-FIELD(4)
*S***
*S*** Specify which PF-KEYS are valid by using RESET INITIAL.
*S** INCLUDE WWPFSTD /* Standard PF-Keys
*S*** INCLUDE WWPFUD /* Scroll up-down keys
*S** RESET INITIAL WWKEYLDA.#SELECT-KEY
*S** WWKEYLDA.#NOTEPAD-KEY
*S** WWKEYLDA.#FORWARD-KEY
*S** WWKEYLDA.#EXPAND-KEY
*S***
*S** MOVE NORMAL-ATTR TO CDATE-CV
*S**END-SUBROUTINE /* INITIALIZATIONS
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE RESET-ARRAY-INDX
*S*************************************************************************
*S***
*S*** Move array 'up' one occurrence.
*S*** (Date changed with no room for break.)
*S** ASSIGN #CNT = #MAX-ARRAY-ENTR - 1
*S** FOR #SUB = 1 TO #CNT
*S** ASSIGN #ARRAY-DATE(#SUB) = #ARRAY-DATE(#SUB+1)
*S** ASSIGN #ARRAY-USER(#SUB) = #ARRAY-USER(#SUB+1)
*S** END-FOR
*S** RESET #ARRAY-DATE(#MAX-ARRAY-ENTR)
*S** #ARRAY-USER(#MAX-ARRAY-ENTR)
*S** /*
*S** ASSIGN #LOW-KY = #SEL-TBL.#KY(#CNT)
*S**END-SUBROUTINE /* RESET-ARRAY-INDX
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE SET-KEYS
*S*************************************************************************
*S***
*S** INCLUDE WWSETKEY /* Set specified keys.
*S** INCLUDE WWSETHLP /* Set PFN=Help
*S**END-SUBROUTINE /* SET-KEYS
*S***
*S**END-REPEAT /* PROG.
*S**PERFORM FINAL-PROCESSING
*S**END
Number of differences: 4
Added(4,1)
Deleted(0,1)
Changed(3)
Changed in changed(2)
Ignored