C:\Documents and Settings\Dan\My Documents\share\FINANCIER\releases\Natural\1210-99\old\wwvalbrn.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
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Subprogram: WWVALBRN
*S*** System : FINANCIER
*S*** Title : Valid value browse program
*S*** Function : This program browses the Dictionary file to display
*S*** value records.
*S***
*S*** Copyright 1995 - 2003 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S** PARAMETER USING WWPDA
*S** PARAMETER
*S** 01 #PDA-KEY(A39)
*S***
*S** LOCAL USING WWDICTOD /* Passed to Object Subprogram WWDICTOO
*S** LOCAL USING WWDICTOR /* Passed to Object Subprogram WWDICTOO
*S** LOCAL USING WWDICTOS /* WW-DICTIONARY 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** LOCAL USING WWFXREFD /* PDA/File cross-reference
*S** LOCAL
*S** /*
*S** /* Constants.
*S** 01 #MAX-PAGES(P3) CONST<15> /* Maximum scroll pages.
*S** 01 #MAX-ARRAY-ENTR(P3) CONST<16> /* 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(A39) /* 1st KEY when looking for match.
*S** 01 #FIRST-INPUT(L) INIT<TRUE> /* Trigger End of Page.
*S** 01 #FIRST-TIME(L) INIT<TRUE> /* First time processing.
*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 #SUB2(P3)
*S** 01 #CNT(P3)
*S** 01 #REV-INDX(P3)
*S** 01 #REV-SUB(P3)
*S** 01 #OUT-TEXT(A30)
*S** 01 #TITLE(A36)
*S** 01 #NO-VALID-VALUES(L)
*S** 01 #SCROLL-INDX(P3) INIT<1>
*S** 01 #DICT-LOOKUP(L)
*S** 01 #EXT-TYPE(A1)
*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 /* Input key value.
*S** 02 #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WW-FILE(A8)
*S** 03 WW-FIELD(A20)
*S** 03 WW-VALUE(A10)
*S** 02 REDEFINE #KY
*S** 03 #KY-RED(A39)
*S** 01 #END-KEY /* End of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WW-FILE(A8)
*S** 02 WW-FIELD(A20)
*S** 02 WW-VALUE(A10)
*S** 01 REDEFINE #END-KEY
*S** 02 #END-KEY-RED(A39)
*S** 01 #BEGIN-KEY /* Beginning of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WW-FILE(A8)
*S** 02 WW-FIELD(A20)
*S** 02 WW-VALUE(A10)
*S** 01 REDEFINE #BEGIN-KEY
*S** 02 #BEGIN-KEY-RED(A39)
*S** /*
*S** 01 #INSIDE-READ-LOOP(L) /* Executing statement inside read.
*S** /*
*S** /* Value of the scroll key on current record
*S** 01 #KEY(A39) /* Key field of record.
*S** 01 #MATCH-FOUND(L) /* Matched Unique Id from table.
*S** 01 #NULL-KEY(A39) /* 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** 01 #DISPLAYED-KEY(A1) /* Used by WWSTDKEY LDA
*S** /*
*S** 01 #SEL-INDX(P5) /* Select table index.
*S** 01 #SEL-TBL(1:#MAX-ARRAY-ENTR) /* Selection table
*S** 02 #KY(A39)
*S** 02 REDEFINE #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WW-FILE(A8)
*S** 03 WW-FIELD(A20)
*S** 03 WW-VALUE(A10)
*S** 01 #SEL-KEY
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WW-FILE(A8)
*S** 02 WW-FIELD(A20)
*S** 02 WW-VALUE(A10)
*S** 01 REDEFINE #SEL-KEY
*S** 02 #SELECTED-KEY(A39) /* Key of selected record.
*S** /*
*S** 01 #SCROLL-TBL(1:#MAX-PAGES) /* Backwards paging selection table
*S** 02 #KY(A39)
*S** 02 REDEFINE #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WW-FILE(A8)
*S** 03 WW-FIELD(A20)
*S** 03 WW-VALUE(A10)
*S** /*
*S** 01 #HPARM(A65)
*S** /*
*S** /* Key value for starting position of read.
*S** 01 #START
*S** 02 #KY(A39)
*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(A39)
*S** 01 #HIGH-KY(A39)
*S** /*
*S** 01 #ARRAYS /* Array of multiple records
*S** 02 #TAB(A1/1:#MAX-ARRAY-ENTR)
*S** 02 #TAB-CV(C/1:#MAX-ARRAY-ENTR)
*S** 02 #VALUE(A10/1:#MAX-ARRAY-ENTR)
*S** 02 #DESCRIPTION(A20/1:#MAX-ARRAY-ENTR)
*S** 01 #BYPASS-INPUT (L) /* Bypass
*S** 01 #EXT-LOOKUP(L)
*S**END-DEFINE
*S***
*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** RESET #NO-VALID-VALUES
*S** /*
*S** IF #FIRST-TIME
*S** RESET INITIAL #BEGIN-KEY
*S** MOVE BY NAME #BEGIN-KEY TO #INPUT.#KY
*S** ASSIGN #INPUT.#KY-RED = #PDA-KEY
*S** COMPRESS #INPUT.WW-FILE '.' #INPUT.WW-FIELD INTO #HPARM
*S** LEAVING NO
*S** /*
*S** PERFORM CHECK-REFERENCE
*S** IF #NO-VALID-VALUES OR
*S** #EXT-LOOKUP
*S** ESCAPE BOTTOM(PROG.) IMMEDIATE
*S** END-IF
*S** MOVE BY NAME #INPUT TO #END-KEY
*S** MOVE BY NAME #INPUT TO #BEGIN-KEY
*S** MOVE ALL H'FF' TO #END-KEY.WW-VALUE
*S** ASSIGN #FORWARD = TRUE
*S** ASSIGN #FIRST-INPUT = TRUE
*S** RESET #FIRST-TIME
*S** END-IF
*S** DEFINE WINDOW VALIDVAL
*S** SIZE 20*40
*S** BASE 2 / 40
*S** TITLE #TITLE
*S** CONTROL SCREEN
*S** FRAMED ON (CD=BL)
*S** POSITION OFF
*S** DEFINE WINDOW NOVALUES
*S** SIZE 5*32
*S** BASE 4 / 15
*S** TITLE 'Valid Values'
*S** CONTROL SCREEN
*S** FRAMED ON (CD=BL)
*S** POSITION OFF
*S** DEFINE WINDOW NOVALRNG
*S** SIZE 5*39
*S** BASE 4 / 15
*S** TITLE 'Valid Values'
*S** CONTROL SCREEN
*S** FRAMED ON (CD=BL)
*S** POSITION OFF
*S** SET WINDOW 'VALIDVAL'
*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.#KY-RED
*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 = #SCROLL-TBL.#KY(#SCROLL-INDX)
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*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 WWDICTOD-ID = #START.#KY
*S** IF #BYPASS-READ
*S** RESET #BYPASS-READ
*S** END-IF
*S** MOVE BY NAME WWDICTOD-ID.STRUCTURE TO WWDICTOD
*S***
*S**READ-FILE. /* Escape this label if end of data processing is needed.
*S** REPEAT
*S** /*
*S** PERFORM CALL-OBJECT
*S** IF WWDICTOD-ID > #END-KEY-RED OR
*S** NOT WWAOBJ.#EXISTS
*S** ASSIGN #END-DATA-FORWARD = TRUE
*S** ESCAPE BOTTOM(READ-FILE.) IMMEDIATE
*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 = WWDICTOD-ID
*S** /*
*S** IF #SEL-INDX = 1
*S** RESET #TAB(*) #ARRAYS.#VALUE(*) #DESCRIPTION(*)
*S** ##MSG ##MSG-DATA(*) ##RETURN-CODE
*S** MOVE NON-DISPLAY-PROT-ATTR TO #TAB-CV(*)
*S** END-IF
*S** /*
*S** IF #FORWARD
*S** IF #SEL-INDX = 1
*S** ASSIGN #SCROLL-TBL.#KY(#SCROLL-INDX) = WWDICTOD-ID
*S** ASSIGN #LOW-KY = WWDICTOD-ID
*S** ASSIGN #HIGH-KY = WWDICTOD-ID
*S** ELSE
*S** ASSIGN #HIGH-KY = WWDICTOD-ID
*S** END-IF
*S** ELSE
*S** IF #SEL-INDX = 1
*S** ASSIGN #SCROLL-TBL.#KY(#SCROLL-INDX) = WWDICTOD-ID
*S** ASSIGN #LOW-KY = WWDICTOD-ID
*S** ASSIGN #HIGH-KY = WWDICTOD-ID
*S** ELSE
*S** ASSIGN #LOW-KY = WWDICTOD-ID
*S** END-IF
*S** END-IF
*S** /*
*S** /* Fill arrays
*S** IF #SEL-INDX NOT > #MAX-ARRAY-ENTR
*S** /*
*S** MOVE WWDICTOD.WW-VALUE TO #ARRAYS.#VALUE(#SEL-INDX)
*S** MOVE WWDICTOD.WW-DEFINITION TO #DESCRIPTION(#SEL-INDX)
*S** MOVE NON-DISPLAY-ATTR TO #TAB-CV(#SEL-INDX)
*S** ASSIGN #SEL-TBL.#KY(#SEL-INDX) = #KEY
*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 'Tab to appropriate value and press ENTER to select'
*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 'WWVALBRM'
*S** /*
*S** INCLUDE WWSTDCHK /* Check standard pf-keys or '.' if first pos.
*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.#EXPAND-KEY /* Valid Value update
*S** /*
*S** /* Call Value maintenance program
*S** MOVE #INPUT.WW-FILE TO ##PASS-KEY
*S** MOVE #INPUT.WW-FIELD TO ##PASS-TEMP
*S** CALLNAT 'WWDICTVN' WW-GDA
*S** RESET ##PASS-KEY ##PASS-TEMP
*S** ASSIGN #FIRST-TIME = TRUE
*S** PERFORM SET-KEYS
*S** VALUE WWKEYLDA.#BACKWARD-KEY /* Scroll backward
*S** /*
*S** /*
*S** IF #SCROLL-INDX = 1
*S** REINPUT FULL 'Top of current list' ALARM
*S** END-IF
*S** SUBTRACT 1 FROM #SCROLL-INDX
*S** /* Get previous starting value from the table.
*S** VALUE WWKEYLDA.#HELP-KEY /* Help key
*S** /*
*S** /*
*S*** COMPRESS WWDICTOD.WW-FILE '.' WWDICTOD.WW-FIELD TO #HPARM
*S*** LEAVING NO
*S** CALLNAT 'WWDICTDN' WW-GDA #HPARM
*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.#SELECT-KEY) THEN
*S** REINPUT FULL 'Invalid program function key' ALARM
*S** END-IF
*S** ASSIGN #FORWARD = TRUE
*S** /*
*S** /* If the cursor was on the data portion of the screen
*S** /* then select the corresponding table entry.
*S** IF *PF-KEY = 'ENTR'
*S** FOR #SUB = 1 TO #MAX-ARRAY-ENTR
*S** IF *CURS-FIELD = POS(#TAB(#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
*S** REINPUT FULL 'Bottom of current list' ALARM
*S** END-IF
*S** IF #SCROLL-INDX + 1 > #MAX-PAGES
*S** /*
*S** /* Push table entries up 1,
*S** /* allows indefinite forward paging
*S** /* and #MAX-PAGES backword paging
*S** FOR #SUB2 = 2 TO #MAX-PAGES
*S** ASSIGN #SCROLL-TBL.#KY(#SUB2 - 1) =
*S** #SCROLL-TBL.#KY(#SUB2)
*S** END-FOR
*S** RESET #SCROLL-TBL.#KY(#MAX-PAGES)
*S** ELSE
*S** COMPUTE #SCROLL-INDX = #SCROLL-INDX + 1
*S** END-IF
*S** END-DECIDE
*S** /*
*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** 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***
*S*** Processing to be performed after a record has been selected.
*S** IF *PF-KEY = 'ENTR'
*S** /*
*S** /* Process #SELECTED-KEY record here.
*S** MOVE #SELECTED-KEY TO #PDA-KEY
*S** ESCAPE ROUTINE IMMEDIATE
*S** ELSE
*S** IGNORE
*S** END-IF
*S** RESET #SELECTED-KEY
*S** END-IF
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CALL-OBJECT
*S*************************************************************************
*S***
*S*** Call WW-DICTIONARY object subprogram (forward key)
*S** CALLNAT 'WWDICTOO' WW-GDA
*S** WWDICTOD
*S** WWDICTOD-ID
*S** WWDICTOR
*S** WWAOBJ
*S** ASSIGN WWAOBJ.#FUNCTION = 'NEXT'
*S**END-SUBROUTINE /* CALL-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CHECK-REFERENCE
*S*************************************************************************
*S***
*S*** Set up Window title
*S** MOVE #INPUT.WW-FILE TO #PDA-FILE-NAME
*S** PERFORM TRANSLATE-PDA-NAME
*S** COMPRESS #PDA-FILE-NAME #INPUT.WW-FIELD INTO
*S** #TITLE WITH DELIMITER '.'
*S***
*S** IF #INPUT.WW-FILE = 'WWSYSVRD' AND
*S** #INPUT.WW-FIELD = MASK(.......X) '.......M'
*S** SET WINDOW 'NOVALUES'
*S** PERFORM NO-VALID-VALUES
*S** ASSIGN #NO-VALID-VALUES = TRUE
*S** ESCAPE ROUTINE IMMEDIATE
*S** END-IF
*S***
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*S** MOVE BY NAME #INPUT TO WWDICTOD
*S** ASSIGN WWDICTOD.WW-RECORD-TYPE = DICT-HEADER-TYPE
*S** ASSIGN WWDICTOD.WW-VALUE = DICT-HEADER-LIT
*S** PERFORM CALL-OBJECT /* Read header rec
*S** IF NOT WWAOBJ.#EXISTS /* No header rec,
*S** SET WINDOW 'NOVALUES' /* therefore no valid values
*S** PERFORM NO-VALID-VALUES
*S** ASSIGN #NO-VALID-VALUES = TRUE
*S** ESCAPE ROUTINE IMMEDIATE
*S** ELSE
*S** MOVE WW-HEADER TO #TITLE
*S** END-IF
*S***
*S** DECIDE FOR EVERY CONDITION
*S** WHEN WWDICTOD.WW-REFER-FILE NE SPACE
*S** ASSIGN WWDICTOD.WW-FILE = WWDICTOD.WW-REFER-FILE
*S** WHEN WWDICTOD.WW-REFER-FIELD NE SPACE
*S** ASSIGN WWDICTOD.WW-FIELD = WWDICTOD.WW-REFER-FIELD
*S** WHEN ANY
*S** /*
*S** /* Determine whether to use Dictionary or External file for
*S** /* browse function
*S** /* (Referenced fields may require External file)
*S** PERFORM DETERMINE-DICT-LOOKUP WWDICTOD.WW-FILE WWDICTOD.WW-FIELD
*S** #DICT-LOOKUP #EXT-TYPE
*S** IF NOT #DICT-LOOKUP
*S** ASSIGN ##PASS-TEMP = 'REFERENCE-EXT'
*S** COMPRESS #EXT-TYPE WWDICTOD.WW-FILE WWDICTOD.WW-FIELD INTO
*S** ##PASS-KEY LEAVING NO
*S** ASSIGN #EXT-LOOKUP = TRUE
*S** ELSE
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*S** PERFORM CALL-OBJECT
*S** END-IF
*S** WHEN NONE
*S** IGNORE
*S** END-DECIDE
*S** /*
*S** /* If not external file lookup,
*S** /* check VALUES-EXIST logical in Dictionary record
*S** IF NOT #EXT-LOOKUP
*S** IF NOT WWDICTOD.WW-VALUES-EXIST /* No header rec,
*S** IF WW-RANGE-HI GT '0'
*S** SET WINDOW 'NOVALRNG'
*S** PERFORM NO-VALUES-RANGE
*S** ELSE
*S** SET WINDOW 'NOVALUES' /* therefore no valid values
*S** PERFORM NO-VALID-VALUES
*S** END-IF
*S** ASSIGN #NO-VALID-VALUES = TRUE
*S** ESCAPE ROUTINE IMMEDIATE
*S** END-IF
*S** END-IF
*S** /*
*S** ASSIGN WWDICTOD.WW-RECORD-TYPE = DICT-VALUE-TYPE
*S** ASSIGN WWDICTOD.WW-VALUE = SPACE
*S** MOVE BY NAME WWDICTOD TO #INPUT
*S***
*S**END-SUBROUTINE /* CHECK-REFERENCE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE FINAL-PROCESSING
*S*************************************************************************
*S***
*S** MOVE BY POSITION WW-GDA TO WW-PDA
*S***
*S** INCLUDE WWEND /* Restore environment.
*S** SET CONTROL 'K0' /* Reset *PF-KEY
*S**END-SUBROUTINE /* FINAL-PROCESSING
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE INITIALIZATIONS
*S*************************************************************************
*S***
*S*** Populate WW-GDA from WW-PDA
*S** MOVE BY POSITION WW-PDA TO WW-GDA
*S***
*S** INCLUDE WWBEGIN /* Capture environment.
*S** SET CONTROL 'WBM'
*S***
*S*** Specify which PF-KEYS are valid by using RESET INITIAL.
*S*** INCLUDE WWPFSTD /* Standard PF-Keys
*S** RESET INITIAL WWKEYLDA.#RETURN-KEY
*S** WWKEYLDA.#EXPAND-KEY
*S** WWKEYLDA.#GOTO-KEY
*S** WWKEYLDA.#MAIN-KEY
*S** WWKEYLDA.#HELP-KEY
*S** INCLUDE WWPFUD /* Scroll up-down keys
*S** PERFORM SET-KEYS
*S***
*S*** Get File/PDA cross-reference
*S** PERFORM FILE-XREF-LOAD WWFXREFD
*S**END-SUBROUTINE /* INITIALIZATIONS
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE NO-VALUES-RANGE
*S*************************************************************************
*S***
*S** MOVE 'To modify range, use Dictionary Maintenance' TO ##MSG
*S** SET KEY NAMED OFF
*S** SET KEY ON
*S** SET KEY PF1 NAMED 'Help'
*S** SET KEY PF11 NAMED 'Retrn'
*S** SET KEY PF2
*S** INPUT WITH TEXT ##MSG
*S** USING MAP 'WWOUTRGM'
*S** IF *PF-KEY = 'PF11' OR = 'ENTR'
*S** IGNORE
*S** ELSE
*S** IF *PF-KEY = 'PF1'
*S** COMPRESS WWDICTOD.WW-FILE '.' WWDICTOD.WW-FIELD TO #HPARM
*S** LEAVING NO
*S** CALLNAT 'WWDICTDN' WW-GDA #HPARM
*S** ELSE
*S** REINPUT WITH TEXT 'Invalid PF-Key selected'
*S** END-IF
*S** END-IF
*S**END-SUBROUTINE /* NO-VALUES-RANGE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE NO-VALID-VALUES
*S*************************************************************************
*S***
*S** IF #INPUT.WW-FILE = 'WWSYSVRD' AND
*S** #INPUT.WW-FIELD = MASK(.......X) '.......M'
*S** MOVE 'Cursor not in datafield' TO #OUT-TEXT
*S** ELSE
*S** MOVE 'No valid values entered' TO #OUT-TEXT
*S** END-IF
*S***
*S** SET KEY NAMED OFF
*S** SET KEY ON
*S** SET KEY PF1 NAMED 'Help'
*S** SET KEY PF11 NAMED 'Retrn'
*S** SET KEY PF2
*S** SET KEY PF9 NAMED 'Expnd'
*S** INPUT WITH TEXT ##MSG,
*S** ##MSG-DATA(1),##MSG-DATA(2),##MSG-DATA(3)
*S** USING MAP 'WWOUTXTM'
*S** IF *PF-KEY = 'PF11' OR = 'ENTR'
*S** IGNORE
*S** ELSE
*S** IF *PF-KEY = 'PF1'
*S** COMPRESS WWDICTOD.WW-FILE '.' WWDICTOD.WW-FIELD TO #HPARM
*S** LEAVING NO
*S** CALLNAT 'WWDICTDN' WW-GDA #HPARM
*S** ELSE
*S** IF *PF-KEY = WWKEYLDA.#EXPAND-KEY /* Valid Value update
*S** /*
*S** /* Call Value maintenance program
*S** MOVE #INPUT.WW-FILE TO ##PASS-KEY
*S** MOVE #INPUT.WW-FIELD TO ##PASS-TEMP
*S** CALLNAT 'WWDICTVN' WW-GDA
*S** RESET ##PASS-KEY ##PASS-TEMP
*S** ASSIGN #FIRST-TIME = TRUE
*S** PERFORM SET-KEYS
*S** ELSE
*S** REINPUT WITH TEXT 'Invalid PF-Key selected'
*S** END-IF
*S** END-IF
*S** END-IF
*S**END-SUBROUTINE /* NO-VALID-VALUES
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE SET-KEYS
*S*************************************************************************
*S***
*S** INCLUDE WWSETKEY /* Set specified keys.
*S*** INCLUDE WWSETHLP /* Set PFN=Help
*S** SET KEY PF1 NAMED 'Help'
*S**END-SUBROUTINE /* SET-KEYS
*S***
*S**INCLUDE WWTRPDAC
*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\wwvalbrn.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
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Subprogram: WWVALBRN
*S*** System : FINANCIER
*S*** Title : Valid value browse program
*S*** Function : This program browses the Dictionary file to display
*S*** value records.
*S***
*S*** Copyright 1995 - 2011 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S** PARAMETER USING WWPDA
*S** PARAMETER
*S** 01 #PDA-KEY(A39)
*S***
*S** LOCAL USING WWDICTOD /* Passed to Object Subprogram WWDICTOO
*S** LOCAL USING WWDICTOR /* Passed to Object Subprogram WWDICTOO
*S** LOCAL USING WWDICTOS /* WW-DICTIONARY 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** LOCAL USING WWFXREFD /* PDA/File cross-reference
*S** LOCAL
*S** /*
*S** /* Constants.
*S** 01 #MAX-PAGES(P3) CONST<15> /* Maximum scroll pages.
*S** 01 #MAX-ARRAY-ENTR(P3) CONST<16> /* 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(A39) /* 1st KEY when looking for match.
*S** 01 #FIRST-INPUT(L) INIT<TRUE> /* Trigger End of Page.
*S** 01 #FIRST-TIME(L) INIT<TRUE> /* First time processing.
*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 #SUB2(P3)
*S** 01 #CNT(P3)
*S** 01 #REV-INDX(P3)
*S** 01 #REV-SUB(P3)
*S** 01 #OUT-TEXT(A30)
*S** 01 #TITLE(A36)
*S** 01 #NO-VALID-VALUES(L)
*S** 01 #SCROLL-INDX(P3) INIT<1>
*S** 01 #DICT-LOOKUP(L)
*S** 01 #EXT-TYPE(A1)
*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 /* Input key value.
*S** 02 #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WW-FILE(A8)
*S** 03 WW-FIELD(A20)
*S** 03 WW-VALUE(A10)
*S** 02 REDEFINE #KY
*S** 03 #KY-RED(A39)
*S** 01 #END-KEY /* End of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WW-FILE(A8)
*S** 02 WW-FIELD(A20)
*S** 02 WW-VALUE(A10)
*S** 01 REDEFINE #END-KEY
*S** 02 #END-KEY-RED(A39)
*S** 01 #BEGIN-KEY /* Beginning of search key
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WW-FILE(A8)
*S** 02 WW-FIELD(A20)
*S** 02 WW-VALUE(A10)
*S** 01 REDEFINE #BEGIN-KEY
*S** 02 #BEGIN-KEY-RED(A39)
*S** /*
*S** 01 #INSIDE-READ-LOOP(L) /* Executing statement inside read.
*S** /*
*S** /* Value of the scroll key on current record
*S** 01 #KEY(A39) /* Key field of record.
*S** 01 #MATCH-FOUND(L) /* Matched Unique Id from table.
*S** 01 #NULL-KEY(A39) /* 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** 01 #DISPLAYED-KEY(A1) /* Used by WWSTDKEY LDA
*S** /*
*S** 01 #SEL-INDX(P5) /* Select table index.
*S** 01 #SEL-TBL(1:#MAX-ARRAY-ENTR) /* Selection table
*S** 02 #KY(A39)
*S** 02 REDEFINE #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WW-FILE(A8)
*S** 03 WW-FIELD(A20)
*S** 03 WW-VALUE(A10)
*S** 01 #SEL-KEY
*S** 02 WW-RECORD-TYPE(A1)
*S** 02 WW-FILE(A8)
*S** 02 WW-FIELD(A20)
*S** 02 WW-VALUE(A10)
*S** 01 REDEFINE #SEL-KEY
*S** 02 #SELECTED-KEY(A39) /* Key of selected record.
*S** /*
*S** 01 #SCROLL-TBL(1:#MAX-PAGES) /* Backwards paging selection table
*S** 02 #KY(A39)
*S** 02 REDEFINE #KY
*S** 03 WW-RECORD-TYPE(A1)
*S** 03 WW-FILE(A8)
*S** 03 WW-FIELD(A20)
*S** 03 WW-VALUE(A10)
*S** /*
*S** 01 #HPARM(A65)
*S** /*
*S** /* Key value for starting position of read.
*S** 01 #START
*S** 02 #KY(A39)
*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(A39)
*S** 01 #HIGH-KY(A39)
*S** /*
*S** 01 #ARRAYS /* Array of multiple records
*S** 02 #TAB(A1/1:#MAX-ARRAY-ENTR)
*S** 02 #TAB-CV(C/1:#MAX-ARRAY-ENTR)
*S** 02 #VALUE(A10/1:#MAX-ARRAY-ENTR)
*S** 02 #DESCRIPTION(A20/1:#MAX-ARRAY-ENTR)
*S** 01 #BYPASS-INPUT (L) /* Bypass
*S** 01 #EXT-LOOKUP(L)
*S**END-DEFINE
*S***
*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** RESET #NO-VALID-VALUES
*S** /*
*S** IF #FIRST-TIME
*S** RESET INITIAL #BEGIN-KEY
*S** MOVE BY NAME #BEGIN-KEY TO #INPUT.#KY
*S** ASSIGN #INPUT.#KY-RED = #PDA-KEY
*S** COMPRESS #INPUT.WW-FILE '.' #INPUT.WW-FIELD INTO #HPARM
*S** LEAVING NO
*S** /*
*S** PERFORM CHECK-REFERENCE
*S** IF #NO-VALID-VALUES OR
*S** #EXT-LOOKUP
*S** ESCAPE BOTTOM(PROG.) IMMEDIATE
*S** END-IF
*S** MOVE BY NAME #INPUT TO #END-KEY
*S** MOVE BY NAME #INPUT TO #BEGIN-KEY
*S** MOVE ALL H'FF' TO #END-KEY.WW-VALUE
*S** ASSIGN #FORWARD = TRUE
*S** ASSIGN #FIRST-INPUT = TRUE
*S** RESET #FIRST-TIME
*S** END-IF
*S** DEFINE WINDOW VALIDVAL
*S** SIZE 20*40
*S** BASE 2 / 40
*S** TITLE #TITLE
*S** CONTROL SCREEN
*S** FRAMED ON (CD=BL)
*S** POSITION OFF
*S** DEFINE WINDOW NOVALUES
*S** SIZE 5*32
*S** BASE 4 / 15
*S** TITLE 'Valid Values'
*S** CONTROL SCREEN
*S** FRAMED ON (CD=BL)
*S** POSITION OFF
*S** DEFINE WINDOW NOVALRNG
*S** SIZE 5*39
*S** BASE 4 / 15
*S** TITLE 'Valid Values'
*S** CONTROL SCREEN
*S** FRAMED ON (CD=BL)
*S** POSITION OFF
*S** SET WINDOW 'VALIDVAL'
*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.#KY-RED
*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 = #SCROLL-TBL.#KY(#SCROLL-INDX)
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*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 WWDICTOD-ID = #START.#KY
*S** IF #BYPASS-READ
*S** RESET #BYPASS-READ
*S** END-IF
*S** MOVE BY NAME WWDICTOD-ID.STRUCTURE TO WWDICTOD
*S***
*S**READ-FILE. /* Escape this label if end of data processing is needed.
*S** REPEAT
*S** /*
*S** PERFORM CALL-OBJECT
*S** IF WWDICTOD-ID > #END-KEY-RED OR
*S** NOT WWAOBJ.#EXISTS
*S** ASSIGN #END-DATA-FORWARD = TRUE
*S** ESCAPE BOTTOM(READ-FILE.) IMMEDIATE
*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 = WWDICTOD-ID
*S** /*
*S** IF #SEL-INDX = 1
*S** RESET #TAB(*) #ARRAYS.#VALUE(*) #DESCRIPTION(*)
*S** ##MSG ##MSG-DATA(*) ##RETURN-CODE
*S** MOVE NON-DISPLAY-PROT-ATTR TO #TAB-CV(*)
*S** END-IF
*S** /*
*S** IF #FORWARD
*S** IF #SEL-INDX = 1
*S** ASSIGN #SCROLL-TBL.#KY(#SCROLL-INDX) = WWDICTOD-ID
*S** ASSIGN #LOW-KY = WWDICTOD-ID
*S** ASSIGN #HIGH-KY = WWDICTOD-ID
*S** ELSE
*S** ASSIGN #HIGH-KY = WWDICTOD-ID
*S** END-IF
*S** ELSE
*S** IF #SEL-INDX = 1
*S** ASSIGN #SCROLL-TBL.#KY(#SCROLL-INDX) = WWDICTOD-ID
*S** ASSIGN #LOW-KY = WWDICTOD-ID
*S** ASSIGN #HIGH-KY = WWDICTOD-ID
*S** ELSE
*S** ASSIGN #LOW-KY = WWDICTOD-ID
*S** END-IF
*S** END-IF
*S** /*
*S** /* Fill arrays
*S** IF #SEL-INDX NOT > #MAX-ARRAY-ENTR
*S** /*
*S** MOVE WWDICTOD.WW-VALUE TO #ARRAYS.#VALUE(#SEL-INDX)
*S** MOVE WWDICTOD.WW-DEFINITION TO #DESCRIPTION(#SEL-INDX)
*S** MOVE NON-DISPLAY-ATTR TO #TAB-CV(#SEL-INDX)
*S** ASSIGN #SEL-TBL.#KY(#SEL-INDX) = #KEY
*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 'Tab to appropriate value and press ENTER to select'
*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 'WWVALBRM'
*S** /*
*S** INCLUDE WWSTDCHK /* Check standard pf-keys or '.' if first pos.
*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.#EXPAND-KEY /* Valid Value update
*S** /*
*S** /* Call Value maintenance program
*S** MOVE #INPUT.WW-FILE TO ##PASS-KEY
*S** MOVE #INPUT.WW-FIELD TO ##PASS-TEMP
*S** CALLNAT 'WWDICTVN' WW-GDA
*S** RESET ##PASS-KEY ##PASS-TEMP
*S** ASSIGN #FIRST-TIME = TRUE
*S** PERFORM SET-KEYS
*S** VALUE WWKEYLDA.#BACKWARD-KEY /* Scroll backward
*S** /*
*S** /*
*S** IF #SCROLL-INDX = 1
*S** REINPUT FULL 'Top of current list' ALARM
*S** END-IF
*S** SUBTRACT 1 FROM #SCROLL-INDX
*S** /* Get previous starting value from the table.
*S** VALUE WWKEYLDA.#HELP-KEY /* Help key
*S** /*
*S** /*
*S*** COMPRESS WWDICTOD.WW-FILE '.' WWDICTOD.WW-FIELD TO #HPARM
*S*** LEAVING NO
*S** CALLNAT 'WWDICTDN' WW-GDA #HPARM
*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.#SELECT-KEY) THEN
*S** REINPUT FULL 'Invalid program function key' ALARM
*S** END-IF
*S** ASSIGN #FORWARD = TRUE
*S** /*
*S** /* If the cursor was on the data portion of the screen
*S** /* then select the corresponding table entry.
*S** IF *PF-KEY = 'ENTR'
*S** FOR #SUB = 1 TO #MAX-ARRAY-ENTR
*S** IF *CURS-FIELD = POS(#TAB(#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
*S** REINPUT FULL 'Bottom of current list' ALARM
*S** END-IF
*S** IF #SCROLL-INDX + 1 > #MAX-PAGES
*S** /*
*S** /* Push table entries up 1,
*S** /* allows indefinite forward paging
*S** /* and #MAX-PAGES backword paging
*S** FOR #SUB2 = 2 TO #MAX-PAGES
*S** ASSIGN #SCROLL-TBL.#KY(#SUB2 - 1) =
*S** #SCROLL-TBL.#KY(#SUB2)
*S** END-FOR
*S** RESET #SCROLL-TBL.#KY(#MAX-PAGES)
*S** ELSE
*S** COMPUTE #SCROLL-INDX = #SCROLL-INDX + 1
*S** END-IF
*S** END-DECIDE
*S** /*
*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** 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***
*S*** Processing to be performed after a record has been selected.
*S** IF *PF-KEY = 'ENTR'
*S** /*
*S** /* Process #SELECTED-KEY record here.
*S** MOVE #SELECTED-KEY TO #PDA-KEY
*S** ESCAPE ROUTINE IMMEDIATE
*S** ELSE
*S** IGNORE
*S** END-IF
*S** RESET #SELECTED-KEY
*S** END-IF
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CALL-OBJECT
*S*************************************************************************
*S***
*S*** Call WW-DICTIONARY object subprogram (forward key)
*S** CALLNAT 'WWDICTOO' WW-GDA
*S** WWDICTOD
*S** WWDICTOD-ID
*S** WWDICTOR
*S** WWAOBJ
*S** ASSIGN WWAOBJ.#FUNCTION = 'NEXT'
*S**END-SUBROUTINE /* CALL-OBJECT
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE CHECK-REFERENCE
*S*************************************************************************
*S***
*S*** Set up Window title
*S** MOVE #INPUT.WW-FILE TO #PDA-FILE-NAME
*S** PERFORM TRANSLATE-PDA-NAME
*S** COMPRESS #PDA-FILE-NAME #INPUT.WW-FIELD INTO
*S** #TITLE WITH DELIMITER '.'
*S***
*S** IF #INPUT.WW-FILE = 'WWSYSVRD' AND
*S** #INPUT.WW-FIELD = MASK(.......X) '.......M'
*S** SET WINDOW 'NOVALUES'
*S** PERFORM NO-VALID-VALUES
*S** ASSIGN #NO-VALID-VALUES = TRUE
*S** ESCAPE ROUTINE IMMEDIATE
*S** END-IF
*S***
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*S** MOVE BY NAME #INPUT TO WWDICTOD
*S** ASSIGN WWDICTOD.WW-RECORD-TYPE = DICT-HEADER-TYPE
*S** ASSIGN WWDICTOD.WW-VALUE = DICT-HEADER-LIT
*S** PERFORM CALL-OBJECT /* Read header rec
*S** IF NOT WWAOBJ.#EXISTS /* No header rec,
*S** SET WINDOW 'NOVALUES' /* therefore no valid values
*S** PERFORM NO-VALID-VALUES
*S** ASSIGN #NO-VALID-VALUES = TRUE
*S** ESCAPE ROUTINE IMMEDIATE
*S** ELSE
*S** MOVE WW-HEADER TO #TITLE
*S** END-IF
*S***
*S** DECIDE FOR EVERY CONDITION
*S** WHEN WWDICTOD.WW-REFER-FILE NE SPACE
*S** ASSIGN WWDICTOD.WW-FILE = WWDICTOD.WW-REFER-FILE
*S** WHEN WWDICTOD.WW-REFER-FIELD NE SPACE
*S** ASSIGN WWDICTOD.WW-FIELD = WWDICTOD.WW-REFER-FIELD
*S** WHEN ANY
*S** /*
*S** /* Determine whether to use Dictionary or External file for
*S** /* browse function
*S** /* (Referenced fields may require External file)
*S** PERFORM DETERMINE-DICT-LOOKUP WWDICTOD.WW-FILE WWDICTOD.WW-FIELD
*S** #DICT-LOOKUP #EXT-TYPE
*S** IF NOT #DICT-LOOKUP
*S** ASSIGN ##PASS-TEMP = 'REFERENCE-EXT'
*S** COMPRESS #EXT-TYPE WWDICTOD.WW-FILE WWDICTOD.WW-FIELD INTO
*S** ##PASS-KEY LEAVING NO
*S** ASSIGN #EXT-LOOKUP = TRUE
*S** ELSE
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*S** PERFORM CALL-OBJECT
*S** END-IF
*S** WHEN NONE
*S** IGNORE
*S** END-DECIDE
*S** /*
*S** /* If not external file lookup,
*S** /* check VALUES-EXIST logical in Dictionary record
*S** IF NOT #EXT-LOOKUP
*S** IF NOT WWDICTOD.WW-VALUES-EXIST /* No header rec,
*S** IF WW-RANGE-HI GT '0'
*S** SET WINDOW 'NOVALRNG'
*S** PERFORM NO-VALUES-RANGE
*S** ELSE
*S** SET WINDOW 'NOVALUES' /* therefore no valid values
*S** PERFORM NO-VALID-VALUES
*S** END-IF
*S** ASSIGN #NO-VALID-VALUES = TRUE
*S** ESCAPE ROUTINE IMMEDIATE
*S** END-IF
*S** END-IF
*S** /*
*S** ASSIGN WWDICTOD.WW-RECORD-TYPE = DICT-VALUE-TYPE
*S** ASSIGN WWDICTOD.WW-VALUE = SPACE
*S** MOVE BY NAME WWDICTOD TO #INPUT
*S***
*S**END-SUBROUTINE /* CHECK-REFERENCE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE FINAL-PROCESSING
*S*************************************************************************
*S***
*S** MOVE BY POSITION WW-GDA TO WW-PDA
*S***
*S** INCLUDE WWEND /* Restore environment.
*S** SET CONTROL 'K0' /* Reset *PF-KEY
*S**END-SUBROUTINE /* FINAL-PROCESSING
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE INITIALIZATIONS
*S*************************************************************************
*S***
*S*** Populate WW-GDA from WW-PDA
*S** MOVE BY POSITION WW-PDA TO WW-GDA
*S***
*S** INCLUDE WWBEGIN /* Capture environment.
*S** SET CONTROL 'WBM'
*S***
*S*** Specify which PF-KEYS are valid by using RESET INITIAL.
*S*** INCLUDE WWPFSTD /* Standard PF-Keys
*S** RESET INITIAL WWKEYLDA.#RETURN-KEY
*S** WWKEYLDA.#EXPAND-KEY
*S** WWKEYLDA.#GOTO-KEY
*S** WWKEYLDA.#MAIN-KEY
*S** WWKEYLDA.#HELP-KEY
*S** INCLUDE WWPFUD /* Scroll up-down keys
*S** PERFORM SET-KEYS
*S***
*S*** Get File/PDA cross-reference
*S** PERFORM FILE-XREF-LOAD WWFXREFD
*S**END-SUBROUTINE /* INITIALIZATIONS
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE NO-VALUES-RANGE
*S*************************************************************************
*S***
*S** MOVE 'To modify range, use Dictionary Maintenance' TO ##MSG
*S** SET KEY NAMED OFF
*S** SET KEY ON
*S** SET KEY PF1 NAMED 'Help'
*S** SET KEY PF11 NAMED 'Retrn'
*S** SET KEY PF2
*S** INPUT WITH TEXT ##MSG
*S** USING MAP 'WWOUTRGM'
*S** IF *PF-KEY = 'PF11' OR = 'ENTR'
*S** IGNORE
*S** ELSE
*S** IF *PF-KEY = 'PF1'
*S** COMPRESS WWDICTOD.WW-FILE '.' WWDICTOD.WW-FIELD TO #HPARM
*S** LEAVING NO
*S** CALLNAT 'WWDICTDN' WW-GDA #HPARM
*S** ELSE
*S** REINPUT WITH TEXT 'Invalid PF-Key selected'
*S** END-IF
*S** END-IF
*S**END-SUBROUTINE /* NO-VALUES-RANGE
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE NO-VALID-VALUES
*S*************************************************************************
*S***
*S** IF #INPUT.WW-FILE = 'WWSYSVRD' AND
*S** #INPUT.WW-FIELD = MASK(.......X) '.......M'
*S** MOVE 'Cursor not in datafield' TO #OUT-TEXT
*S** ELSE
*S** MOVE 'No valid values entered' TO #OUT-TEXT
*S** END-IF
*S***
*S** SET KEY NAMED OFF
*S** SET KEY ON
*S** SET KEY PF1 NAMED 'Help'
*S** SET KEY PF11 NAMED 'Retrn'
*S** SET KEY PF2
*S** SET KEY PF9 NAMED 'Expnd'
*S** INPUT WITH TEXT ##MSG,
*S** ##MSG-DATA(1),##MSG-DATA(2),##MSG-DATA(3)
*S** USING MAP 'WWOUTXTM'
*S** IF *PF-KEY = 'PF11' OR = 'ENTR'
*S** IGNORE
*S** ELSE
*S** IF *PF-KEY = 'PF1'
*S** COMPRESS WWDICTOD.WW-FILE '.' WWDICTOD.WW-FIELD TO #HPARM
*S** LEAVING NO
*S** CALLNAT 'WWDICTDN' WW-GDA #HPARM
*S** ELSE
*S** IF *PF-KEY = WWKEYLDA.#EXPAND-KEY /* Valid Value update
*S** /*
*S** /* Call Value maintenance program
*S** MOVE #INPUT.WW-FILE TO ##PASS-KEY
*S** MOVE #INPUT.WW-FIELD TO ##PASS-TEMP
*S** CALLNAT 'WWDICTVN' WW-GDA
*S** RESET ##PASS-KEY ##PASS-TEMP
*S** ASSIGN #FIRST-TIME = TRUE
*S** PERFORM SET-KEYS
*S** ELSE
*S** REINPUT WITH TEXT 'Invalid PF-Key selected'
*S** END-IF
*S** END-IF
*S** END-IF
*S**END-SUBROUTINE /* NO-VALID-VALUES
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE SET-KEYS
*S*************************************************************************
*S***
*S** INCLUDE WWSETKEY /* Set specified keys.
*S*** INCLUDE WWSETHLP /* Set PFN=Help
*S** SET KEY PF1 NAMED 'Help'
*S**END-SUBROUTINE /* SET-KEYS
*S***
*S**INCLUDE WWTRPDAC
*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