C:\Users\skylight120\Desktop\schema4c\old\wftcr18n.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
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Subprogram: WFTCR18N
*S*** System : FINANCIER
*S*** Title : Federal Grant Export
*S*** Function : This subprogram produces TEACH Federal Grant records
*S*** to be converted by WFFLEyyB to XML documents ready
*S*** for transmittal to COD.
*S***
*S*** Copyright 1995 - 2017 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S** PARAMETER USING WWPDA
*S** PARAMETER USING WWREQIBD
*S** PARAMETER USING WFTCH18D
*S** PARAMETER USING WWTABLED
*S** PARAMETER USING WWSTDNCD
*S** PARAMETER USING WFCPS18D
*S** PARAMETER USING WFFED18D
*S** PARAMETER USING WFISW18D
*S** PARAMETER
*S** 01 #REPORT-TEACH(L)
*S** PARAMETER
*S** 01 #ACCUMULATORS
*S** 02 #STUDENT-COUNT(P7)
*S** 02 #P-STNT-COUNT (P7)
*S** 02 #P-AWRD-TOTAL (P13.2)
*S** 02 #P-AWRD-NET (P13.2)
*S** 02 #P-DISB-TOTAL (P13.2)
*S** 02 #P-DISB-NET (P13.2)
*S** 02 #T-STNT-COUNT (P7)
*S** 02 #T-AWRD-TOTAL (P13.2)
*S** 02 #T-AWRD-NET (P13.2)
*S** 02 #T-DISB-TOTAL (P13.2)
*S** 02 #T-DISB-NET (P13.2)
*S** PARAMETER
*S** 01 #PRINT-LINE
*S** 02 #PRT-STUDENT-ID(A9)
*S** 02 #PRT-STUDENT-NAME(A20)
*S** 02 #PRT-FED-TRAN(A2)
*S** 02 #FILLER(A1)
*S** 02 #PRT-GRANT(A6)
*S** 02 #PRT-RECTYPE(A4)
*S** 02 #PRT-AMT(A8)
*S** 02 #PRT-COMMENT(A20)
*S** PARAMETER
*S** 01 #ERROR-LINE
*S** 02 #ERR-STUDENT-ID(A9)
*S** 02 #ERR-STUDENT-NAME(A20)
*S** 02 #ERR-FED-TRAN(A2)
*S** 02 #FILLER(A1)
*S** 02 #ERR-GRANT(A6)
*S** 02 #ERR-RECTYPE(A4)
*S** 02 #ERR-AMT(A8)
*S** 02 #ERR-COMMENT(A20)
*S***
*S** LOCAL USING WWCONST
*S** LOCAL USING WFFLE18D
*S** LOCAL USING WFFID18D /* Instituional Data Load
*S** LOCAL USING WWCALEND /* Passed to object subprogram
*S** LOCAL USING WWCALENR /* Passed to object subprogram
*S** LOCAL USING WWAOBJ /*
*S***
*S** LOCAL
*S** 01 #REPORT-ORIG(L)
*S** 01 #REPORT-DISB(L)
*S** 01 #REPORT-ERROR(L)
*S***
*S** 01 #EVENT-TYPE(A5)
*S** 01 #EVENT-DESC(A40)
*S** 01 #EVENT-ORIGINATION
*S** 02 #EO-ORIG-LABEL(A6) INIT<'Orig '>
*S** 02 #EO-CLAS-LABEL(A6) INIT<'Class='>
*S** 02 #EO-CLAS-VALUE(A1)
*S** 02 #EO-TRAN-LABEL(A14) INIT<' FederalTran#='>
*S** 02 #EO-TRAN-VALUE(A2)
*S** 02 #EO-AWRD-LABEL(A5) INIT<' Awd='>
*S** 02 #EO-AWRD-VALUE(A6)
*S** 01 REDEFINE #EVENT-ORIGINATION
*S** 02 #EVENT-ORIG(A40)
*S** 01 #EVENT-DISBURSEMENT
*S** 02 #ED-DISB-LABEL(A6) INIT<'Disb '>
*S** 02 #ED-DSBN-LABEL(A5) INIT<'Dsb#='>
*S** 02 #ED-DSBN-VALUE(A2)
*S** 02 #ED-SEQN-LABEL(A6) INIT<' Seq#='>
*S** 02 #ED-SEQN-VALUE(A2)
*S** 02 #ED-FILLER (A1) INIT<' '>
*S** 02 #ED-DPNM-VALUE(A7)
*S** 02 #ED-DSBV-LABEL(A5) INIT<' Dsb='>
*S** 02 #ED-DSBV-VALUE(A6)
*S** 01 REDEFINE #EVENT-DISBURSEMENT
*S** 02 #EVENT-DISB(A40)
*S***
*S** 01 #WW-CALENDAR
*S** 02 WW-RT01-BEG-DATE(D)
*S** 02 WW-RT02-BEG-DATE(D)
*S** 02 WW-RT03-BEG-DATE(D)
*S** 02 WW-RT04-BEG-DATE(D)
*S** 02 WW-RT05-BEG-DATE(D)
*S** 02 WW-RT06-BEG-DATE(D)
*S** 02 WW-RT07-BEG-DATE(D)
*S** 02 WW-RT08-BEG-DATE(D)
*S** 02 WW-RT09-BEG-DATE(D)
*S** 02 WW-RT10-BEG-DATE(D)
*S** 02 WW-RT11-BEG-DATE(D)
*S** 02 WW-RT12-BEG-DATE(D)
*S** 01 REDEFINE #WW-CALENDAR
*S** 02 #WW-TERM-START-DATE(D/12)
*S***
*S** 01 #CAL-TBL-VAL(A10)
*S** 01 REDEFINE #CAL-TBL-VAL
*S** 02 #CAL-AY(A4)
*S** 02 #CAL-FAO(A2)
*S** 02 #CAL-SCHED(A1)
*S***
*S** 01 #SUB(N2) /* Used for passed array and schedule array
*S** 01 #DSUB(N2) /* Used for passed array searches
*S** 01 #ESUB(N2) /* Used for export array
*S** 01 #HOLD-NUM(N2)
*S***
*S** 01 #GRANT-ID(A23)
*S** 01 REDEFINE #GRANT-ID
*S** 02 #GID-SSN(A9)
*S** 02 #GID-TYPE(A1)
*S** 02 #GID-YEAR(A2)
*S** 02 #GID-SCHOOL(A6)
*S** 02 #GID-NUM(N3)
*S***
*S** 01 #AID-CCYY(A4)
*S** 01 REDEFINE #AID-CCYY
*S** 02 #AID-CC(A2)
*S** 02 #AID-YY(A2)
*S***
*S** 01 #FID-TYPE(A5) INIT<'Teach'>
*S** 01 #FID-FUNCTION(A6) INIT<'EXPORT'>
*S***
*S** 01 #DISB-SUB(P3)
*S** 01 #TERM-SUB(P3)
*S** 01 #SCHED-DP(A1/12)
*S**END-DEFINE
*S***
*S*** Define printers, formats, headings
*S**FORMAT(2) LS=80 PS=60 ZP=ON IS=OFF ES=OFF SG=OFF
*S**FORMAT(3) LS=80 PS=60 ZP=ON IS=OFF ES=OFF SG=OFF
*S***
*S**AT TOP OF PAGE(2)
*S** WRITE(2) NOTITLE ##PGM-ID
*S** 21T '*** FINANCIER FEDERAL GRANT EXPORT ***'
*S** 71T 'Page' *PAGE-NUMBER(2)(EM=ZZ9)
*S** / *DATX(EM=LLL' 'DD', 'YYYY)
*S** 31T 'Students in Error'
*S** 71T *TIMX(EM=HH':'II' 'AP)
*S** // 31T 'Aid Year:' ##DISP-AY
*S** / 36T ##DISP-LIT ##DISP-FAO
*S** /// 'StudentID Name Tran Grant Transaction'
*S** 'Errors'
*S** SKIP(2) 1
*S**END-TOPPAGE
*S**AT TOP OF PAGE(3)
*S** WRITE(3) NOTITLE *PROGRAM
*S** 21T '*** FINANCIER FEDERAL GRANT EXPORT ***'
*S** 71T 'Page' *PAGE-NUMBER(3)(EM=ZZ9)
*S** / *DATX(EM=LLL' 'DD', 'YYYY)
*S** 31T 'Reported Students'
*S** 71T *TIMX(EM=HH':'II' 'AP)
*S** // 31T 'Aid Year:' ##DISP-AY
*S** / 36T ##DISP-LIT ##DISP-FAO
*S** /// 'StudentID Name Tran Grant Transaction'
*S** SKIP(3) 1
*S**END-TOPPAGE
*S***
*S***
*S*** Populate WW-GDA from WW-PDA
*S**MOVE BY POSITION WW-PDA TO WW-GDA
*S**MOVE ##AID-YEAR TO #AID-CCYY
*S***
*S**ASSIGN #TEACH-ACTION = 'G'
*S**RESET #TEACH1-DATA #TEACH2-DATA #TEACH-ACTIVE-FUND(*)
*S***
*S*** Prefill FY fields if previous report
*S**MOVE WFCPS18D.WF-CP-RT1-FY TO #CUR-T1-FY
*S**MOVE WFCPS18D.WF-CP-RT2-FY TO #CUR-T2-FY
*S***
*S**PERFORM TEACH-REPORT-1718 #INPUT-EFF-DATE-D WFTCH18D
*S***
*S**PERFORM GET-TERM-BEG-DATES
*S***
*S**PERFORM DECIDE-TO-REPORT-TEACH1
*S**PERFORM DECIDE-TO-REPORT-TEACH2
*S**IF #REPORT-TEACH
*S** ASSIGN #TEACH-ACTION = 'R'
*S** PERFORM TEACH-REPORT-1718 #INPUT-EFF-DATE-D WFTCH18D
*S**END-IF
*S***
*S*** Populate WW-GDA from WW-PDA
*S**MOVE BY POSITION WW-GDA TO WW-PDA
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE DECIDE-TO-REPORT-TEACH1
*S*************************************************************************
*S** /*
*S** /* If Runmode is not RECOVER, skip anyone who has a "hold" action;
*S** /* skip anyone who has been reported and the COD response has not
*S** /* been received and processed unless re-report has been requested;
*S** /* skip anyone who has no award and no previously-reported award
*S** /* If Runmode is RECOVER, skip anyone who was not reported
*S** /* on the Effective Date
*S** IF #INPUT-RUNMODE NE 'RECOVER' AND
*S** (WFCPS18D.WF-CP-RT1-ACT = 'H' OR
*S** (WFCPS18D.WF-CP-RT1-RPT-DATE > WFCPS18D.WF-CP-RT1-O-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT1-RPT-DATE > WFCPS18D.WF-CP-RT1-D-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT1-ACT NE 'R') OR
*S** (#CUR-T1-AWARD = 0 AND WFCPS18D.WF-CP-RT1-A-AWARD = 0))
*S** ESCAPE ROUTINE
*S** END-IF
*S** IF #INPUT-RUNMODE = 'RECOVER'
*S** IF WFCPS18D.WF-CP-RT1-RPT-DATE NE #INPUT-EFF-DATE-D
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** /*
*S** RESET #REPORT-ORIG #REPORT-DISB #REPORT-ERROR
*S** RESET WFFLE18D #ESUB
*S** /*
*S** /* Retrieve institutional data
*S** FOR #DISB-SUB = 1 TO 12
*S** IF #CUR-T1-D-DP(#DISB-SUB) <> ' ' AND
*S** (#CUR-T1-D-OFF(#DISB-SUB) <> 0 OR
*S** #CUR-T1-D-DIS(#DISB-SUB) <> 0)
*S** MOVE #CUR-T1-D-DP(#DISB-SUB) TO #SCHED-DP(#DISB-SUB)
*S** END-IF
*S** END-FOR
*S** PERFORM LOAD-INST-DATA
*S** /*
*S** /* Set up print line
*S** MOVE 'TEACH1' TO #PRT-GRANT #ERR-GRANT
*S** MOVE 'Orig' TO #PRT-RECTYPE #ERR-RECTYPE
*S** MOVE EDITED #CUR-T1-AWARD (EM=Z,ZZZ.99) TO #PRT-AMT
*S** MOVE EDITED #CUR-T1-AWARD (EM=Z,ZZZ.99) TO #ERR-AMT
*S** /*
*S** IF #CUR-T1-AWARD > 0
*S** IF NOT WFISW18D.#EXISTS
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'No ISIR' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF WFCPS18D.WF-CP-FED-ID = ' '
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Federal ID' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T1-YR-COL LT '1' OR
*S** #CUR-T1-YR-COL GT '7'
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Class level' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T1-ENR-DATE = INIT-DATE
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Enrollment date' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** /* Invalid ATB codes
*S** /* (03 & 05 retired)
*S** IF WWSTDNCD.WW-ST-ATB-CODE = ' ' OR
*S** (WWSTDNCD.WW-ST-ATB-CODE = '03' OR
*S** WWSTDNCD.WW-ST-ATB-CODE = '05')
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'ATB code' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #REPORT-ERROR
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** IF (#INPUT-RUNMODE = 'RECOVER' AND
*S** WFCPS18D.WF-CP-RT1-RPT-DATE = #INPUT-EFF-DATE-D) OR
*S** WFCPS18D.WF-CP-RT1-ACT = 'R' OR
*S** #CUR-T1-YR-COL NE WFCPS18D.WF-CP-RT1-A-YR-COL OR
*S** #CUR-T1-ENR-DATE NE WFCPS18D.WF-CP-RT1-A-ENR-DATE OR
*S** #CUR-T1-AWARD NE WFCPS18D.WF-CP-RT1-A-AWARD
*S** ASSIGN #REPORT-ORIG = TRUE
*S** ADD #CUR-T1-AWARD TO #T-AWRD-NET
*S** SUBTRACT WFCPS18D.WF-CP-RT1-A-AWARD FROM #T-AWRD-NET
*S** /*
*S** /* Move origination data to be reported to "report" CPS fields
*S** MOVE 1 TO WFCPS18D.WF-CP-RT1-R-GRANT
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO WFCPS18D.WF-CP-RT1-R-FED-TRAN
*S** MOVE #CUR-T1-YR-COL TO WFCPS18D.WF-CP-RT1-R-YR-COL
*S** MOVE #CUR-T1-ENR-DATE TO WFCPS18D.WF-CP-RT1-R-ENR-DATE
*S** MOVE #CUR-T1-AWARD TO WFCPS18D.WF-CP-RT1-R-AWARD
*S** /*
*S** /* Create origination event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-ORIGINATION
*S** MOVE #CUR-T1-YR-COL TO #EO-CLAS-VALUE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #EO-TRAN-VALUE
*S** MOVE EDITED #CUR-T1-AWARD (EM=ZZ,ZZ9) TO #EO-AWRD-VALUE
*S** MOVE #EVENT-ORIG TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-IF
*S** /*
*S** /* Clear any old reported/unacknowledged data
*S** RESET #RPT-T1-D-NUM(*) #RPT-T1-D-SEQ(*)
*S** #RPT-T1-D-DIS(*) #RPT-T1-D-DATE(*) #RPT-T1-D-REL(*)
*S** /*
*S** /* Cycle through disbursements
*S** FOR #SUB = 1 TO 12
*S** IF #CUR-T1-D-DP(#SUB) = ' ' AND
*S** #ACK-T1-D-NUM(#SUB) = 0
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* If previously reported and nothing has changed, skip
*S** IF (#ACK-T1-D-REL(#SUB) = 'Y' AND
*S** #CUR-T1-D-DIS(#SUB) = #ACK-T1-D-DIS(#SUB)) OR
*S** (#ACK-T1-D-REL(#SUB) NE 'Y' AND
*S** #CUR-T1-D-OFF(#SUB) = #ACK-T1-D-DIS(#SUB) AND
*S** #CUR-T1-D-DIS(#SUB) = 0)
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* Set up print line
*S** MOVE 'Disb' TO #PRT-RECTYPE
*S** MOVE EDITED #CUR-T1-D-DIS(#SUB) (EM=Z,ZZZ.99) TO #PRT-AMT
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #PRT-COMMENT
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #PRT-COMMENT
*S** END-IF
*S** /*
*S** ASSIGN #REPORT-DISB = TRUE
*S** IF #ACK-T1-D-REL(#SUB) = 'Y' OR
*S** #CUR-T1-D-DIS(#SUB) > 0
*S** ADD #CUR-T1-D-DIS(#SUB) TO #T-DISB-TOTAL
*S** ELSE
*S** ADD #CUR-T1-D-OFF(#SUB) TO #T-DISB-TOTAL
*S** END-IF
*S** ADD #CUR-T1-D-DIS(#SUB) TO #T-DISB-NET
*S** SUBTRACT #ACK-T1-D-DIS(#SUB) FROM #T-DISB-NET
*S** /*
*S** /* Move disbursements to be reported to "report" fields in array
*S** IF #ACK-T1-D-NUM(#SUB) = 0
*S** RESET #HOLD-NUM
*S** FOR #DSUB = 1 TO 12
*S** IF #ACK-T1-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #ACK-T1-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** IF #RPT-T1-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #RPT-T1-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** END-FOR
*S** COMPUTE #RPT-T1-D-NUM(#SUB) = #HOLD-NUM + 1
*S** MOVE 1 TO #RPT-T1-D-SEQ(#SUB)
*S** ELSE
*S** MOVE #ACK-T1-D-NUM(#SUB) TO #RPT-T1-D-NUM(#SUB)
*S** IF #ACK-T1-D-REL(#SUB) = 'Y'
*S** COMPUTE #RPT-T1-D-SEQ(#SUB) = #ACK-T1-D-SEQ(#SUB) + 1
*S** ELSE
*S** MOVE 1 TO #RPT-T1-D-SEQ(#SUB)
*S** END-IF
*S** END-IF
*S** IF #ACK-T1-D-REL(#SUB) = 'Y' OR
*S** #CUR-T1-D-DIS(#SUB) > 0
*S** MOVE #CUR-T1-D-DIS(#SUB) TO #RPT-T1-D-DIS(#SUB)
*S** MOVE 'Y' TO #RPT-T1-D-REL(#SUB)
*S** ELSE
*S** MOVE #CUR-T1-D-OFF(#SUB) TO #RPT-T1-D-DIS(#SUB)
*S** MOVE 'N' TO #RPT-T1-D-REL(#SUB)
*S** END-IF
*S** IF #CUR-T1-D-DATE(#SUB) = INIT-DATE
*S** MOVE #ACK-T1-D-DATE(#SUB) TO #RPT-T1-D-DATE(#SUB)
*S** ELSE
*S** MOVE #CUR-T1-D-DATE(#SUB) TO #RPT-T1-D-DATE(#SUB)
*S** END-IF
*S** /*
*S** /* Create disbursement event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-DISBURSEMENT
*S** MOVE EDITED #RPT-T1-D-NUM(#SUB) (EM=99) TO #ED-DSBN-VALUE
*S** MOVE EDITED #RPT-T1-D-SEQ(#SUB) (EM=99) TO #ED-SEQN-VALUE
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #ED-DPNM-VALUE
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #ED-DPNM-VALUE
*S** END-IF
*S** MOVE EDITED #RPT-T1-D-DIS(#SUB) (EM=ZZ,ZZ9) TO #ED-DSBV-VALUE
*S** MOVE #EVENT-DISB TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-FOR
*S** /*
*S** IF #REPORT-ORIG OR #REPORT-DISB
*S** ASSIGN #REPORT-TEACH = TRUE
*S** ADD 1 TO #T-STNT-COUNT
*S** ADD #CUR-T1-AWARD TO #T-AWRD-TOTAL
*S** /*
*S** /* Load CPS data
*S** RESET WFCPS18D.WF-CP-RT1-ACT
*S** WFCPS18D.WF-CP-RT1-ACT-RSN
*S** WFCPS18D.WF-CP-RT1-ACT-DATE
*S** IF WFCPS18D.WF-CP-RT1-FY = ' '
*S** MOVE #CUR-T1-FY TO WFCPS18D.WF-CP-RT1-FY
*S** END-IF
*S** MOVE #INPUT-EFF-DATE-D TO WFCPS18D.WF-CP-RT1-RPT-DATE
*S** IF #REPORT-DISB
*S** MOVE #CUR-T1-DISB TO WFCPS18D.WF-CP-RT1-R-DISB
*S** END-IF
*S** /*
*S** /* Load export data
*S** ASSIGN WFFLE18D.#EXPORT-PROGRAM = 'TEACH'
*S** ASSIGN WFFLE18D.#EXPORT-AIDYEAR = ##AID-YEAR
*S** ASSIGN WFFLE18D.#EXPORT-FAO = ##FAO-ID
*S** ASSIGN WFFLE18D.#EXPORT-OPEID = WWTABLED.WW-OPE-ID
*S** /*
*S** MOVE WFISW18D.#SSN TO #E-ORIG-SSN
*S** IF WFISW18D.#DOB = MASK(YYYYMMDD)
*S** MOVE EDITED WFISW18D.#DOB TO #E-ORIG-DOB (EM=YYYYMMDD)
*S** END-IF
*S** MOVE WFISW18D.#NM-LAST TO #E-ORIG-LAST
*S** MOVE WFISW18D.#NM-FIRST TO #E-ORIG-FIRST
*S** MOVE WFISW18D.#NM-MI TO #E-ORIG-MI
*S** MOVE ##SID TO #E-ORIG-STUDENT-ID
*S** /*
*S** MOVE WFISW18D.#AD-STRT TO #E-ORIG-AD-STRT
*S** MOVE WFISW18D.#AD-CITY TO #E-ORIG-AD-CITY
*S** MOVE WFISW18D.#AD-STATE TO #E-ORIG-AD-STATE
*S** MOVE WFISW18D.#AD-ZIP TO #E-ORIG-AD-ZIP
*S** /*
*S** DECIDE FOR FIRST CONDITION
*S** WHEN WFFED18D.WF-FE-S-CIT = 'U'
*S** ASSIGN #E-ORIG-CIT = '1'
*S** WHEN WFFED18D.WF-FE-S-CIT = 'E'
*S** ASSIGN #E-ORIG-CIT = '2'
*S** WHEN NONE
*S** IGNORE
*S** END-DECIDE
*S** DECIDE FOR FIRST CONDITION
*S** WHEN #REPORT-ORIG AND NOT #REPORT-DISB
*S** MOVE 'ORIG' TO #E-ORIG-UPDATE
*S** WHEN NOT #REPORT-ORIG AND #REPORT-DISB
*S** MOVE 'DISB' TO #E-ORIG-UPDATE
*S** WHEN NONE
*S** MOVE 'BOTH' TO #E-ORIG-UPDATE
*S** END-DECIDE
*S** /*
*S** MOVE WFISW18D.#SSN TO #GID-SSN
*S** MOVE 'H' TO #GID-TYPE
*S** MOVE #AID-YY TO #GID-YEAR
*S** MOVE WWTABLED.WW-INST-ID TO #GID-SCHOOL
*S** MOVE 1 TO #GID-NUM
*S** /*
*S** MOVE #GRANT-ID TO #E-ORIG-GRANT-ID
*S** MOVE 1 TO #E-ORIG-GRANT-NUM
*S** /*
*S** MOVE WWSTDNCD.WW-ST-ATB-STATE TO #E-ORIG-ATB-STATE
*S** MOVE WWSTDNCD.WW-ST-ATB-CODE TO #E-ORIG-ATB-CODE
*S** MOVE WWSTDNCD.WW-ST-ATB-ADMN TO #E-ORIG-ATB-ADMN
*S** MOVE WWSTDNCD.WW-ST-ATB-TEST TO #E-ORIG-ATB-TEST
*S** MOVE WWSTDNCD.WW-ST-ATB-DATE TO #E-ORIG-ATB-DATE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #E-ORIG-FEDID-TRAN
*S** MOVE #CUR-T1-YR-COL TO #E-ORIG-YR-COL
*S** MOVE #CUR-T1-ENR-DATE TO #E-ORIG-ENR-DATE
*S** MOVE #CUR-T1-AWARD TO #E-ORIG-AWARD
*S** FOR #DSUB = 1 TO 12
*S** IF #RPT-T1-D-NUM(#DSUB) NE 0
*S** ADD 1 TO #ESUB
*S** MOVE #RPT-T1-D-NUM(#DSUB) TO #E-DISB-NUMBER(#ESUB)
*S** MOVE #RPT-T1-D-SEQ(#DSUB) TO #E-DISB-SEQ(#ESUB)
*S** MOVE #CUR-T1-D-DP(#DSUB) TO #E-DISB-DP(#ESUB)
*S** MOVE #RPT-T1-D-DIS(#DSUB) TO #E-DISB-AMOUNT(#ESUB)
*S** MOVE #RPT-T1-D-DATE(#DSUB) TO #E-DISB-DATE(#ESUB)
*S** MOVE #RPT-T1-D-REL(#DSUB) TO #E-DISB-REL(#ESUB)
*S** /*
*S** /* Term start date, enrollment and cip
*S** /*
*S** IF ##SCHED-DP(#DSUB) = #CUR-T1-D-DP(#DSUB)
*S** MOVE BY NAME WFFID18D.#EXPORT-DISBURSEMENT(#DSUB) TO
*S** WFFLE18D.#EXPORT-DISBURSEMENT(#ESUB)
*S** FOR #TERM-SUB = 1 TO 12
*S** IF ##SCHED-RT(#TERM-SUB) = ##SCHED-DP-RT(#DSUB)
*S** MOVE #WW-TERM-START-DATE(#TERM-SUB) TO
*S** WFFLE18D.#E-DISB-PAYPD-START-DATE(#ESUB)
*S** ESCAPE BOTTOM
*S** END-IF
*S** END-FOR
*S** END-IF
*S** END-IF
*S** END-FOR
*S** /*
*S** WRITE WORK FILE 2 WFFLE18D
*S** END-IF
*S**END-SUBROUTINE /* DECIDE-TO-REPORT-TEACH1
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE DECIDE-TO-REPORT-TEACH2
*S*************************************************************************
*S** /*
*S** /* If Runmode is not RECOVER, skip anyone who has a "hold" action;
*S** /* skip anyone who has been reported and the COD response has not
*S** /* been received and processed unless re-report has been requested;
*S** /* skip anyone who has no award and no previously-reported award
*S** /* If Runmode is RECOVER, skip anyone who was not reported
*S** /* on the Effective Date
*S** IF #INPUT-RUNMODE NE 'RECOVER' AND
*S** (WFCPS18D.WF-CP-RT2-ACT = 'H' OR
*S** (WFCPS18D.WF-CP-RT2-RPT-DATE > WFCPS18D.WF-CP-RT2-O-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT2-RPT-DATE > WFCPS18D.WF-CP-RT2-D-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT2-ACT NE 'R') OR
*S** (#CUR-T2-AWARD = 0 AND WFCPS18D.WF-CP-RT2-A-AWARD = 0))
*S** ESCAPE ROUTINE
*S** END-IF
*S** IF #INPUT-RUNMODE = 'RECOVER'
*S** IF WFCPS18D.WF-CP-RT2-RPT-DATE NE #INPUT-EFF-DATE-D
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** /*
*S** RESET #REPORT-ORIG #REPORT-DISB #REPORT-ERROR
*S** RESET WFFLE18D #ESUB
*S** FOR #DISB-SUB = 1 TO 12
*S** IF #CUR-T2-D-DP(#DISB-SUB) <> ' ' AND
*S** (#CUR-T2-D-OFF(#DISB-SUB) <> 0 OR
*S** #CUR-T2-D-DIS(#DISB-SUB) <> 0)
*S** MOVE #CUR-T2-D-DP(#DISB-SUB) TO #SCHED-DP(#DISB-SUB)
*S** END-IF
*S** END-FOR
*S** PERFORM LOAD-INST-DATA
*S** /*
*S** /* Set up print line
*S** MOVE 'TEACH2' TO #PRT-GRANT #ERR-GRANT
*S** MOVE 'Orig' TO #PRT-RECTYPE #ERR-RECTYPE
*S** MOVE EDITED #CUR-T2-AWARD (EM=Z,ZZZ.99) TO #PRT-AMT
*S** MOVE EDITED #CUR-T2-AWARD (EM=Z,ZZZ.99) TO #ERR-AMT
*S** /*
*S** IF #CUR-T2-AWARD > 0
*S** IF NOT WFISW18D.#EXISTS
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'No ISIR' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF WFCPS18D.WF-CP-FED-ID = ' '
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Federal ID' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T2-YR-COL LT '1' OR
*S** #CUR-T2-YR-COL GT '7'
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Class level' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T2-ENR-DATE = INIT-DATE
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Enrollment date' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** /* Invalid ATB codes
*S** /* (03 & 05 retired)
*S** IF WWSTDNCD.WW-ST-ATB-CODE = ' ' OR
*S** (WWSTDNCD.WW-ST-ATB-CODE = '03' OR
*S** WWSTDNCD.WW-ST-ATB-CODE = '05')
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'ATB code' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #REPORT-ERROR
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** IF (#INPUT-RUNMODE = 'RECOVER' AND
*S** WFCPS18D.WF-CP-RT2-RPT-DATE = #INPUT-EFF-DATE-D) OR
*S** WFCPS18D.WF-CP-RT2-ACT = 'R' OR
*S** #CUR-T2-YR-COL NE WFCPS18D.WF-CP-RT2-A-YR-COL OR
*S** #CUR-T2-ENR-DATE NE WFCPS18D.WF-CP-RT2-A-ENR-DATE OR
*S** #CUR-T2-AWARD NE WFCPS18D.WF-CP-RT2-A-AWARD
*S** ASSIGN #REPORT-ORIG = TRUE
*S** ADD #CUR-T2-AWARD TO #T-AWRD-NET
*S** SUBTRACT WFCPS18D.WF-CP-RT2-A-AWARD FROM #T-AWRD-NET
*S** /*
*S** /* Move origination data to be reported to "report" CPS fields
*S** MOVE 2 TO WFCPS18D.WF-CP-RT2-R-GRANT
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO WFCPS18D.WF-CP-RT2-R-FED-TRAN
*S** MOVE #CUR-T2-YR-COL TO WFCPS18D.WF-CP-RT2-R-YR-COL
*S** MOVE #CUR-T2-ENR-DATE TO WFCPS18D.WF-CP-RT2-R-ENR-DATE
*S** MOVE #CUR-T2-AWARD TO WFCPS18D.WF-CP-RT2-R-AWARD
*S** /*
*S** /* Create origination event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-ORIGINATION
*S** MOVE #CUR-T2-YR-COL TO #EO-CLAS-VALUE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #EO-TRAN-VALUE
*S** MOVE EDITED #CUR-T2-AWARD (EM=ZZ,ZZ9) TO #EO-AWRD-VALUE
*S** MOVE #EVENT-ORIG TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-IF
*S** /*
*S** /* Clear any old reported/unacknowledged data
*S** RESET #RPT-T2-D-NUM(*) #RPT-T2-D-SEQ(*)
*S** #RPT-T2-D-DIS(*) #RPT-T2-D-DATE(*) #RPT-T2-D-REL(*)
*S** /*
*S** /* Cycle through disbursements
*S** FOR #SUB = 1 TO 12
*S** IF #CUR-T2-D-DP(#SUB) = ' ' AND
*S** #ACK-T2-D-NUM(#SUB) = 0
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* If previously reported and nothing has changed, skip
*S** IF (#ACK-T2-D-REL(#SUB) = 'Y' AND
*S** #CUR-T2-D-DIS(#SUB) = #ACK-T2-D-DIS(#SUB)) OR
*S** (#ACK-T2-D-REL(#SUB) NE 'Y' AND
*S** #CUR-T2-D-OFF(#SUB) = #ACK-T2-D-DIS(#SUB) AND
*S** #CUR-T2-D-DIS(#SUB) = 0)
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* Set up print line
*S** MOVE 'Disb' TO #PRT-RECTYPE
*S** MOVE EDITED #CUR-T2-D-DIS(#SUB) (EM=Z,ZZZ.99) TO #PRT-AMT
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #PRT-COMMENT
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #PRT-COMMENT
*S** END-IF
*S** /*
*S** ASSIGN #REPORT-DISB = TRUE
*S** IF #ACK-T2-D-REL(#SUB) = 'Y' OR
*S** #CUR-T2-D-DIS(#SUB) > 0
*S** ADD #CUR-T2-D-DIS(#SUB) TO #T-DISB-TOTAL
*S** ELSE
*S** ADD #CUR-T2-D-OFF(#SUB) TO #T-DISB-TOTAL
*S** END-IF
*S** ADD #CUR-T2-D-DIS(#SUB) TO #T-DISB-NET
*S** SUBTRACT #ACK-T2-D-DIS(#SUB) FROM #T-DISB-NET
*S** /*
*S** /* Move disbursements to be reported to "report" fields in array
*S** IF #ACK-T2-D-NUM(#SUB) = 0
*S** RESET #HOLD-NUM
*S** FOR #DSUB = 1 TO 12
*S** IF #ACK-T2-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #ACK-T2-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** IF #RPT-T2-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #RPT-T2-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** END-FOR
*S** COMPUTE #RPT-T2-D-NUM(#SUB) = #HOLD-NUM + 1
*S** MOVE 1 TO #RPT-T2-D-SEQ(#SUB)
*S** ELSE
*S** MOVE #ACK-T2-D-NUM(#SUB) TO #RPT-T2-D-NUM(#SUB)
*S** IF #ACK-T2-D-REL(#SUB) = 'Y'
*S** COMPUTE #RPT-T2-D-SEQ(#SUB) = #ACK-T2-D-SEQ(#SUB) + 1
*S** ELSE
*S** MOVE 1 TO #RPT-T2-D-SEQ(#SUB)
*S** END-IF
*S** END-IF
*S** IF #ACK-T2-D-REL(#SUB) = 'Y' OR
*S** #CUR-T2-D-DIS(#SUB) > 0
*S** MOVE #CUR-T2-D-DIS(#SUB) TO #RPT-T2-D-DIS(#SUB)
*S** MOVE 'Y' TO #RPT-T2-D-REL(#SUB)
*S** ELSE
*S** MOVE #CUR-T2-D-OFF(#SUB) TO #RPT-T2-D-DIS(#SUB)
*S** MOVE 'N' TO #RPT-T2-D-REL(#SUB)
*S** END-IF
*S** IF #CUR-T2-D-DATE(#SUB) = INIT-DATE
*S** MOVE #ACK-T2-D-DATE(#SUB) TO #RPT-T2-D-DATE(#SUB)
*S** ELSE
*S** MOVE #CUR-T2-D-DATE(#SUB) TO #RPT-T2-D-DATE(#SUB)
*S** END-IF
*S** /*
*S** /* Create disbursement event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-DISBURSEMENT
*S** MOVE EDITED #RPT-T2-D-NUM(#SUB) (EM=99) TO #ED-DSBN-VALUE
*S** MOVE EDITED #RPT-T2-D-SEQ(#SUB) (EM=99) TO #ED-SEQN-VALUE
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #ED-DPNM-VALUE
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #ED-DPNM-VALUE
*S** END-IF
*S** MOVE EDITED #RPT-T2-D-DIS(#SUB) (EM=ZZ,ZZ9) TO #ED-DSBV-VALUE
*S** MOVE #EVENT-DISB TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-FOR
*S** /*
*S** IF #REPORT-ORIG OR #REPORT-DISB
*S** ASSIGN #REPORT-TEACH = TRUE
*S** ADD 1 TO #T-STNT-COUNT
*S** ADD #CUR-T2-AWARD TO #T-AWRD-TOTAL
*S** /*
*S** /* Load CPS data
*S** RESET WFCPS18D.WF-CP-RT2-ACT
*S** WFCPS18D.WF-CP-RT2-ACT-RSN
*S** WFCPS18D.WF-CP-RT2-ACT-DATE
*S** IF WFCPS18D.WF-CP-RT2-FY = ' '
*S** MOVE #CUR-T2-FY TO WFCPS18D.WF-CP-RT2-FY
*S** END-IF
*S** MOVE #INPUT-EFF-DATE-D TO WFCPS18D.WF-CP-RT2-RPT-DATE
*S** IF #REPORT-DISB
*S** MOVE #CUR-T2-DISB TO WFCPS18D.WF-CP-RT2-R-DISB
*S** END-IF
*S** /*
*S** /* Load export data
*S** ASSIGN WFFLE18D.#EXPORT-PROGRAM = 'TEACH'
*S** ASSIGN WFFLE18D.#EXPORT-AIDYEAR = ##AID-YEAR
*S** ASSIGN WFFLE18D.#EXPORT-FAO = ##FAO-ID
*S** ASSIGN WFFLE18D.#EXPORT-OPEID = WWTABLED.WW-OPE-ID
*S** /*
*S** MOVE WFISW18D.#SSN TO #E-ORIG-SSN
*S** IF WFISW18D.#DOB = MASK(YYYYMMDD)
*S** MOVE EDITED WFISW18D.#DOB TO #E-ORIG-DOB (EM=YYYYMMDD)
*S** END-IF
*S** MOVE WFISW18D.#NM-LAST TO #E-ORIG-LAST
*S** MOVE WFISW18D.#NM-FIRST TO #E-ORIG-FIRST
*S** MOVE WFISW18D.#NM-MI TO #E-ORIG-MI
*S** MOVE ##SID TO #E-ORIG-STUDENT-ID
*S** /*
*S** MOVE WFISW18D.#AD-STRT TO #E-ORIG-AD-STRT
*S** MOVE WFISW18D.#AD-CITY TO #E-ORIG-AD-CITY
*S** MOVE WFISW18D.#AD-STATE TO #E-ORIG-AD-STATE
*S** MOVE WFISW18D.#AD-ZIP TO #E-ORIG-AD-ZIP
*S** /*
*S** DECIDE FOR FIRST CONDITION
*S** WHEN WFFED18D.WF-FE-S-CIT = 'U'
*S** ASSIGN #E-ORIG-CIT = '1'
*S** WHEN WFFED18D.WF-FE-S-CIT = 'E'
*S** ASSIGN #E-ORIG-CIT = '2'
*S** WHEN NONE
*S** IGNORE
*S** END-DECIDE
*S** DECIDE FOR FIRST CONDITION
*S** WHEN #REPORT-ORIG AND NOT #REPORT-DISB
*S** MOVE 'ORIG' TO #E-ORIG-UPDATE
*S** WHEN NOT #REPORT-ORIG AND #REPORT-DISB
*S** MOVE 'DISB' TO #E-ORIG-UPDATE
*S** WHEN NONE
*S** MOVE 'BOTH' TO #E-ORIG-UPDATE
*S** END-DECIDE
*S** /*
*S** MOVE WFISW18D.#SSN TO #GID-SSN
*S** MOVE 'H' TO #GID-TYPE
*S** MOVE #AID-YY TO #GID-YEAR
*S** MOVE WWTABLED.WW-INST-ID TO #GID-SCHOOL
*S** MOVE 2 TO #GID-NUM
*S** /*
*S** MOVE #GRANT-ID TO #E-ORIG-GRANT-ID
*S** MOVE 2 TO #E-ORIG-GRANT-NUM
*S** /*
*S** MOVE WWSTDNCD.WW-ST-ATB-STATE TO #E-ORIG-ATB-STATE
*S** MOVE WWSTDNCD.WW-ST-ATB-CODE TO #E-ORIG-ATB-CODE
*S** MOVE WWSTDNCD.WW-ST-ATB-ADMN TO #E-ORIG-ATB-ADMN
*S** MOVE WWSTDNCD.WW-ST-ATB-TEST TO #E-ORIG-ATB-TEST
*S** MOVE WWSTDNCD.WW-ST-ATB-DATE TO #E-ORIG-ATB-DATE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #E-ORIG-FEDID-TRAN
*S** MOVE #CUR-T2-YR-COL TO #E-ORIG-YR-COL
*S** MOVE #CUR-T2-ENR-DATE TO #E-ORIG-ENR-DATE
*S** MOVE #CUR-T2-AWARD TO #E-ORIG-AWARD
*S** FOR #DSUB = 1 TO 12
*S** IF #RPT-T2-D-NUM(#DSUB) NE 0
*S** ADD 1 TO #ESUB
*S** MOVE #RPT-T2-D-NUM(#DSUB) TO #E-DISB-NUMBER(#ESUB)
*S** MOVE #RPT-T2-D-SEQ(#DSUB) TO #E-DISB-SEQ(#ESUB)
*S** MOVE #CUR-T2-D-DP(#DSUB) TO #E-DISB-DP(#ESUB)
*S** MOVE #RPT-T2-D-DIS(#DSUB) TO #E-DISB-AMOUNT(#ESUB)
*S** MOVE #RPT-T2-D-DATE(#DSUB) TO #E-DISB-DATE(#ESUB)
*S** MOVE #RPT-T2-D-REL(#DSUB) TO #E-DISB-REL(#ESUB)
*S** /*
*S** /* Term start date, enrollment and cip
*S** /*
*S** IF ##SCHED-DP(#DSUB) = #CUR-T1-D-DP(#DSUB)
*S** MOVE BY NAME WFFID18D.#EXPORT-DISBURSEMENT(#DSUB) TO
*S** WFFLE18D.#EXPORT-DISBURSEMENT(#ESUB)
*S** FOR #TERM-SUB = 1 TO 12
*S** IF ##SCHED-RT(#TERM-SUB) = ##SCHED-DP-RT(#DSUB)
*S** MOVE #WW-TERM-START-DATE(#TERM-SUB) TO
*S** WFFLE18D.#E-DISB-PAYPD-START-DATE(#ESUB)
*S** ESCAPE BOTTOM
*S** END-IF
*S** END-FOR
*S** END-IF
*S** END-IF
*S** END-FOR
*S** WRITE WORK FILE 2 WFFLE18D
*S** END-IF
*S**END-SUBROUTINE /* DECIDE-TO-REPORT-TEACH2
*S*************************************************************************
*S**DEFINE SUBROUTINE LOAD-INST-DATA
*S*************************************************************************
*S** /* Retrieve Teach Export data from outside of Financier
*S** CALLNAT 'WFFID18N' WW-GDA
*S** #FID-TYPE
*S** #FID-FUNCTION
*S** #SCHED-DP(*)
*S** WFFID18D
*S** /* Move instituional data from PDA to Grant data PDA
*S** MOVE BY NAME WFFID18D TO WFFLE18D
*S***
*S**END-SUBROUTINE /* LOAD-INST-DATA
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE GET-TERM-BEG-DATES
*S*************************************************************************
*S** /* Get calendar for student's schedule
*S** ASSIGN WWCALEND.WW-RECORD-TYPE = TABLE-TYPE
*S** ASSIGN WWCALEND.WW-TABLE-ID = 'CALEN' /* Calendar table
*S** MOVE ##AID-YEAR TO #CAL-AY
*S** MOVE ##FAO-ID TO #CAL-FAO
*S** MOVE ##SCHED-ID TO #CAL-SCHED
*S** ASSIGN WWCALEND.WW-TABLE-VALUE = #CAL-TBL-VAL
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*S** CALLNAT 'WWCALENO' WW-GDA
*S** WWCALEND
*S** WWCALEND-ID
*S** WWCALENR
*S** WWAOBJ
*S** MOVE BY NAME WWCALEND TO #WW-CALENDAR
*S** /*
*S**END-SUBROUTINE /* GET-TERM-BEG-DATES
*S***
*S**END
*E
C:\Users\skylight120\Desktop\schema4c\new\wftcr18n.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
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
*S*************************************************************************
*S***
*S*** WolffPack
*S***
*S*** Subprogram: WFTCR18N
*S*** System : FINANCIER
*S*** Title : Federal Grant Export
*S*** Function : This subprogram produces TEACH Federal Grant records
*S*** to be converted by WFFLEyyB to XML documents ready
*S*** for transmittal to COD.
*S***
*S*** Copyright 1995 - 2017 WolffPack, Inc. All rights reserved.
*S***
*S*************************************************************************
*S**DEFINE DATA
*S** GLOBAL USING WWGDA
*S** PARAMETER USING WWPDA
*S** PARAMETER USING WWREQIBD
*S** PARAMETER USING WFTCH18D
*S** PARAMETER USING WWTABLED
*S** PARAMETER USING WWSTDNCD
*S** PARAMETER USING WFCPS18D
*S** PARAMETER USING WFFED18D
*S** PARAMETER USING WFISW18D
*S** PARAMETER
*S** 01 #REPORT-TEACH(L)
*S** PARAMETER
*S** 01 #ACCUMULATORS
*S** 02 #STUDENT-COUNT(P7)
*S** 02 #P-STNT-COUNT (P7)
*S** 02 #P-AWRD-TOTAL (P13.2)
*S** 02 #P-AWRD-NET (P13.2)
*S** 02 #P-DISB-TOTAL (P13.2)
*S** 02 #P-DISB-NET (P13.2)
*S** 02 #T-STNT-COUNT (P7)
*S** 02 #T-AWRD-TOTAL (P13.2)
*S** 02 #T-AWRD-NET (P13.2)
*S** 02 #T-DISB-TOTAL (P13.2)
*S** 02 #T-DISB-NET (P13.2)
*S** PARAMETER
*S** 01 #PRINT-LINE
*S** 02 #PRT-STUDENT-ID(A9)
*S** 02 #PRT-STUDENT-NAME(A20)
*S** 02 #PRT-FED-TRAN(A2)
*S** 02 #FILLER(A1)
*S** 02 #PRT-GRANT(A6)
*S** 02 #PRT-RECTYPE(A4)
*S** 02 #PRT-AMT(A8)
*S** 02 #PRT-COMMENT(A20)
*S** PARAMETER
*S** 01 #ERROR-LINE
*S** 02 #ERR-STUDENT-ID(A9)
*S** 02 #ERR-STUDENT-NAME(A20)
*S** 02 #ERR-FED-TRAN(A2)
*S** 02 #FILLER(A1)
*S** 02 #ERR-GRANT(A6)
*S** 02 #ERR-RECTYPE(A4)
*S** 02 #ERR-AMT(A8)
*S** 02 #ERR-COMMENT(A20)
*S***
*S** LOCAL USING WWCONST
*S** LOCAL USING WFFLE18D
*S** LOCAL USING WFFID18D /* Instituional Data Load
*S** LOCAL USING WWCALEND /* Passed to object subprogram
*S** LOCAL USING WWCALENR /* Passed to object subprogram
*S** LOCAL USING WWAOBJ /*
*S***
*S** LOCAL
*S** 01 #REPORT-ORIG(L)
*S** 01 #REPORT-DISB(L)
*S** 01 #REPORT-ERROR(L)
*S***
*S** 01 #EVENT-TYPE(A5)
*S** 01 #EVENT-DESC(A40)
*S** 01 #EVENT-ORIGINATION
*S** 02 #EO-ORIG-LABEL(A6) INIT<'Orig '>
*S** 02 #EO-CLAS-LABEL(A6) INIT<'Class='>
*S** 02 #EO-CLAS-VALUE(A1)
*S** 02 #EO-TRAN-LABEL(A14) INIT<' FederalTran#='>
*S** 02 #EO-TRAN-VALUE(A2)
*S** 02 #EO-AWRD-LABEL(A5) INIT<' Awd='>
*S** 02 #EO-AWRD-VALUE(A6)
*S** 01 REDEFINE #EVENT-ORIGINATION
*S** 02 #EVENT-ORIG(A40)
*S** 01 #EVENT-DISBURSEMENT
*S** 02 #ED-DISB-LABEL(A6) INIT<'Disb '>
*S** 02 #ED-DSBN-LABEL(A5) INIT<'Dsb#='>
*S** 02 #ED-DSBN-VALUE(A2)
*S** 02 #ED-SEQN-LABEL(A6) INIT<' Seq#='>
*S** 02 #ED-SEQN-VALUE(A2)
*S** 02 #ED-FILLER (A1) INIT<' '>
*S** 02 #ED-DPNM-VALUE(A7)
*S** 02 #ED-DSBV-LABEL(A5) INIT<' Dsb='>
*S** 02 #ED-DSBV-VALUE(A6)
*S** 01 REDEFINE #EVENT-DISBURSEMENT
*S** 02 #EVENT-DISB(A40)
*S***
*S** 01 #WW-CALENDAR
*S** 02 WW-RT01-BEG-DATE(D)
*S** 02 WW-RT02-BEG-DATE(D)
*S** 02 WW-RT03-BEG-DATE(D)
*S** 02 WW-RT04-BEG-DATE(D)
*S** 02 WW-RT05-BEG-DATE(D)
*S** 02 WW-RT06-BEG-DATE(D)
*S** 02 WW-RT07-BEG-DATE(D)
*S** 02 WW-RT08-BEG-DATE(D)
*S** 02 WW-RT09-BEG-DATE(D)
*S** 02 WW-RT10-BEG-DATE(D)
*S** 02 WW-RT11-BEG-DATE(D)
*S** 02 WW-RT12-BEG-DATE(D)
*S** 01 REDEFINE #WW-CALENDAR
*S** 02 #WW-TERM-START-DATE(D/12)
*S***
*S** 01 #CAL-TBL-VAL(A10)
*S** 01 REDEFINE #CAL-TBL-VAL
*S** 02 #CAL-AY(A4)
*S** 02 #CAL-FAO(A2)
*S** 02 #CAL-SCHED(A1)
*S***
*S** 01 #SUB(N2) /* Used for passed array and schedule array
*S** 01 #DSUB(N2) /* Used for passed array searches
*S** 01 #ESUB(N2) /* Used for export array
*S** 01 #HOLD-NUM(N2)
*S***
*S** 01 #GRANT-ID(A23)
*S** 01 REDEFINE #GRANT-ID
*S** 02 #GID-SSN(A9)
*S** 02 #GID-TYPE(A1)
*S** 02 #GID-YEAR(A2)
*S** 02 #GID-SCHOOL(A6)
*S** 02 #GID-NUM(N3)
*S***
*S** 01 #AID-CCYY(A4)
*S** 01 REDEFINE #AID-CCYY
*S** 02 #AID-CC(A2)
*S** 02 #AID-YY(A2)
*S***
*S** 01 #FID-TYPE(A5) INIT<'Teach'>
*S** 01 #FID-FUNCTION(A6) INIT<'EXPORT'>
*S***
*S** 01 #DISB-SUB(P3)
*S** 01 #TERM-SUB(P3)
*S** 01 #SCHED-DP(A1/12)
*S**END-DEFINE
*S***
*S*** Define printers, formats, headings
*S**FORMAT(2) LS=80 PS=60 ZP=ON IS=OFF ES=OFF SG=OFF
*S**FORMAT(3) LS=80 PS=60 ZP=ON IS=OFF ES=OFF SG=OFF
*S***
*S**AT TOP OF PAGE(2)
*S** WRITE(2) NOTITLE ##PGM-ID
*S** 21T '*** FINANCIER FEDERAL GRANT EXPORT ***'
*S** 71T 'Page' *PAGE-NUMBER(2)(EM=ZZ9)
*S** / *DATX(EM=LLL' 'DD', 'YYYY)
*S** 31T 'Students in Error'
*S** 71T *TIMX(EM=HH':'II' 'AP)
*S** // 31T 'Aid Year:' ##DISP-AY
*S** / 36T ##DISP-LIT ##DISP-FAO
*S** /// 'StudentID Name Tran Grant Transaction'
*S** 'Errors'
*S** SKIP(2) 1
*S**END-TOPPAGE
*S**AT TOP OF PAGE(3)
*S** WRITE(3) NOTITLE *PROGRAM
*S** 21T '*** FINANCIER FEDERAL GRANT EXPORT ***'
*S** 71T 'Page' *PAGE-NUMBER(3)(EM=ZZ9)
*S** / *DATX(EM=LLL' 'DD', 'YYYY)
*S** 31T 'Reported Students'
*S** 71T *TIMX(EM=HH':'II' 'AP)
*S** // 31T 'Aid Year:' ##DISP-AY
*S** / 36T ##DISP-LIT ##DISP-FAO
*S** /// 'StudentID Name Tran Grant Transaction'
*S** SKIP(3) 1
*S**END-TOPPAGE
*S***
*S***
*S*** Populate WW-GDA from WW-PDA
*S**MOVE BY POSITION WW-PDA TO WW-GDA
*S**MOVE ##AID-YEAR TO #AID-CCYY
*S***
*S**ASSIGN #TEACH-ACTION = 'G'
*S**RESET #TEACH1-DATA #TEACH2-DATA #TEACH-ACTIVE-FUND(*)
*S***
*S*** Prefill FY fields if previous report
*S**MOVE WFCPS18D.WF-CP-RT1-FY TO #CUR-T1-FY
*S**MOVE WFCPS18D.WF-CP-RT2-FY TO #CUR-T2-FY
*S***
*S**PERFORM TEACH-REPORT-1718 #INPUT-EFF-DATE-D WFTCH18D
*S***
*S**PERFORM GET-TERM-BEG-DATES
*S***
*S**PERFORM DECIDE-TO-REPORT-TEACH1
*S**PERFORM DECIDE-TO-REPORT-TEACH2
*S**IF #REPORT-TEACH
*S** ASSIGN #TEACH-ACTION = 'R'
*S** PERFORM TEACH-REPORT-1718 #INPUT-EFF-DATE-D WFTCH18D
*S**END-IF
*S***
*S*** Populate WW-GDA from WW-PDA
*S**MOVE BY POSITION WW-GDA TO WW-PDA
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE DECIDE-TO-REPORT-TEACH1
*S*************************************************************************
*S** /*
*S** /* If Runmode is not RECOVER, skip anyone who has a "hold" action;
*S** /* skip anyone who has been reported and the COD response has not
*S** /* been received and processed unless re-report has been requested;
*S** /* skip anyone who has no award and no previously-reported award
*S** /* If Runmode is RECOVER, skip anyone who was not reported
*S** /* on the Effective Date
*S** IF #INPUT-RUNMODE NE 'RECOVER' AND
*S** (WFCPS18D.WF-CP-RT1-ACT = 'H' OR
*S** (WFCPS18D.WF-CP-RT1-RPT-DATE > WFCPS18D.WF-CP-RT1-O-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT1-RPT-DATE > WFCPS18D.WF-CP-RT1-D-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT1-ACT NE 'R') OR
*S** (#CUR-T1-AWARD = 0 AND WFCPS18D.WF-CP-RT1-A-AWARD = 0))
*S** ESCAPE ROUTINE
*S** END-IF
*S** IF #INPUT-RUNMODE = 'RECOVER'
*S** IF WFCPS18D.WF-CP-RT1-RPT-DATE NE #INPUT-EFF-DATE-D
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** /*
*S** RESET #REPORT-ORIG #REPORT-DISB #REPORT-ERROR
*S** RESET WFFLE18D #ESUB
*S** /*
*S** /* Retrieve institutional data
*S** FOR #DISB-SUB = 1 TO 12
*S** IF #CUR-T1-D-DP(#DISB-SUB) <> ' ' AND
*S** (#CUR-T1-D-OFF(#DISB-SUB) <> 0 OR
*S** #CUR-T1-D-DIS(#DISB-SUB) <> 0)
*S** MOVE #CUR-T1-D-DP(#DISB-SUB) TO #SCHED-DP(#DISB-SUB)
*S** END-IF
*S** END-FOR
*S** PERFORM LOAD-INST-DATA
*S** /*
*S** /* Set up print line
*S** MOVE 'TEACH1' TO #PRT-GRANT #ERR-GRANT
*S** MOVE 'Orig' TO #PRT-RECTYPE #ERR-RECTYPE
*S** MOVE EDITED #CUR-T1-AWARD (EM=Z,ZZZ.99) TO #PRT-AMT
*S** MOVE EDITED #CUR-T1-AWARD (EM=Z,ZZZ.99) TO #ERR-AMT
*S** /*
*S** IF #CUR-T1-AWARD > 0
*S** IF NOT WFISW18D.#EXISTS
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'No ISIR' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF WFCPS18D.WF-CP-FED-ID = ' '
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Federal ID' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T1-YR-COL LT '1' OR
*S** #CUR-T1-YR-COL GT '7'
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Class level' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T1-ENR-DATE = INIT-DATE
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Enrollment date' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** /* Invalid ATB codes
*S** /* (03 & 05 retired)
*S** IF WWSTDNCD.WW-ST-ATB-CODE = ' ' OR
*S** (WWSTDNCD.WW-ST-ATB-CODE = '03' OR
*S** WWSTDNCD.WW-ST-ATB-CODE = '05')
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'ATB code' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #REPORT-ERROR
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** IF (#INPUT-RUNMODE = 'RECOVER' AND
*S** WFCPS18D.WF-CP-RT1-RPT-DATE = #INPUT-EFF-DATE-D) OR
*S** WFCPS18D.WF-CP-RT1-ACT = 'R' OR
*S** #CUR-T1-YR-COL NE WFCPS18D.WF-CP-RT1-A-YR-COL OR
*S** #CUR-T1-ENR-DATE NE WFCPS18D.WF-CP-RT1-A-ENR-DATE OR
*S** #CUR-T1-AWARD NE WFCPS18D.WF-CP-RT1-A-AWARD
*S** ASSIGN #REPORT-ORIG = TRUE
*S** ADD #CUR-T1-AWARD TO #T-AWRD-NET
*S** SUBTRACT WFCPS18D.WF-CP-RT1-A-AWARD FROM #T-AWRD-NET
*S** /*
*S** /* Move origination data to be reported to "report" CPS fields
*S** MOVE 1 TO WFCPS18D.WF-CP-RT1-R-GRANT
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO WFCPS18D.WF-CP-RT1-R-FED-TRAN
*S** MOVE #CUR-T1-YR-COL TO WFCPS18D.WF-CP-RT1-R-YR-COL
*S** MOVE #CUR-T1-ENR-DATE TO WFCPS18D.WF-CP-RT1-R-ENR-DATE
*S** MOVE #CUR-T1-AWARD TO WFCPS18D.WF-CP-RT1-R-AWARD
*S** /*
*S** /* Create origination event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-ORIGINATION
*S** MOVE #CUR-T1-YR-COL TO #EO-CLAS-VALUE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #EO-TRAN-VALUE
*S** MOVE EDITED #CUR-T1-AWARD (EM=ZZ,ZZ9) TO #EO-AWRD-VALUE
*S** MOVE #EVENT-ORIG TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-IF
*S** /*
*S** /* Clear any old reported/unacknowledged data
*S** RESET #RPT-T1-D-NUM(*) #RPT-T1-D-SEQ(*)
*S** #RPT-T1-D-DIS(*) #RPT-T1-D-DATE(*) #RPT-T1-D-REL(*)
*S** /*
*S** /* Cycle through disbursements
*S** FOR #SUB = 1 TO 12
*S** IF #CUR-T1-D-DP(#SUB) = ' ' AND
*S** #ACK-T1-D-NUM(#SUB) = 0
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* If previously reported and nothing has changed, skip
*S** IF (#ACK-T1-D-REL(#SUB) = 'Y' AND
*S** #CUR-T1-D-DIS(#SUB) = #ACK-T1-D-DIS(#SUB)) OR
*S** (#ACK-T1-D-REL(#SUB) NE 'Y' AND
*S** #CUR-T1-D-OFF(#SUB) = #ACK-T1-D-DIS(#SUB) AND
*S** #CUR-T1-D-DIS(#SUB) = 0)
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* Set up print line
*S** MOVE 'Disb' TO #PRT-RECTYPE
*S** MOVE EDITED #CUR-T1-D-DIS(#SUB) (EM=Z,ZZZ.99) TO #PRT-AMT
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #PRT-COMMENT
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #PRT-COMMENT
*S** END-IF
*S** /*
*S** ASSIGN #REPORT-DISB = TRUE
*S** IF #ACK-T1-D-REL(#SUB) = 'Y' OR
*S** #CUR-T1-D-DIS(#SUB) > 0
*S** ADD #CUR-T1-D-DIS(#SUB) TO #T-DISB-TOTAL
*S** ELSE
*S** ADD #CUR-T1-D-OFF(#SUB) TO #T-DISB-TOTAL
*S** END-IF
*S** ADD #CUR-T1-D-DIS(#SUB) TO #T-DISB-NET
*S** SUBTRACT #ACK-T1-D-DIS(#SUB) FROM #T-DISB-NET
*S** /*
*S** /* Move disbursements to be reported to "report" fields in array
*S** IF #ACK-T1-D-NUM(#SUB) = 0
*S** RESET #HOLD-NUM
*S** FOR #DSUB = 1 TO 12
*S** IF #ACK-T1-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #ACK-T1-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** IF #RPT-T1-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #RPT-T1-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** END-FOR
*S** COMPUTE #RPT-T1-D-NUM(#SUB) = #HOLD-NUM + 1
*S** MOVE 1 TO #RPT-T1-D-SEQ(#SUB)
*S** ELSE
*S** MOVE #ACK-T1-D-NUM(#SUB) TO #RPT-T1-D-NUM(#SUB)
*S** IF #ACK-T1-D-REL(#SUB) = 'Y'
*S** COMPUTE #RPT-T1-D-SEQ(#SUB) = #ACK-T1-D-SEQ(#SUB) + 1
*S** ELSE
*S** MOVE 1 TO #RPT-T1-D-SEQ(#SUB)
*S** END-IF
*S** END-IF
*S** IF #ACK-T1-D-REL(#SUB) = 'Y' OR
*S** #CUR-T1-D-DIS(#SUB) > 0
*S** MOVE #CUR-T1-D-DIS(#SUB) TO #RPT-T1-D-DIS(#SUB)
*S** MOVE 'Y' TO #RPT-T1-D-REL(#SUB)
*S** ELSE
*S** MOVE #CUR-T1-D-OFF(#SUB) TO #RPT-T1-D-DIS(#SUB)
*S** MOVE 'N' TO #RPT-T1-D-REL(#SUB)
*S** END-IF
*S** IF #CUR-T1-D-DATE(#SUB) = INIT-DATE
*S** MOVE #ACK-T1-D-DATE(#SUB) TO #RPT-T1-D-DATE(#SUB)
*S** ELSE
*S** MOVE #CUR-T1-D-DATE(#SUB) TO #RPT-T1-D-DATE(#SUB)
*S** END-IF
*S** /*
*S** /* Create disbursement event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-DISBURSEMENT
*S** MOVE EDITED #RPT-T1-D-NUM(#SUB) (EM=99) TO #ED-DSBN-VALUE
*S** MOVE EDITED #RPT-T1-D-SEQ(#SUB) (EM=99) TO #ED-SEQN-VALUE
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #ED-DPNM-VALUE
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #ED-DPNM-VALUE
*S** END-IF
*S** MOVE EDITED #RPT-T1-D-DIS(#SUB) (EM=ZZ,ZZ9) TO #ED-DSBV-VALUE
*S** MOVE #EVENT-DISB TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-FOR
*S** /*
*S** IF #REPORT-ORIG OR #REPORT-DISB
*S** ASSIGN #REPORT-TEACH = TRUE
*S** ADD 1 TO #T-STNT-COUNT
*S** ADD #CUR-T1-AWARD TO #T-AWRD-TOTAL
*S** /*
*S** /* Load CPS data
*S** RESET WFCPS18D.WF-CP-RT1-ACT
*S** WFCPS18D.WF-CP-RT1-ACT-RSN
*S** WFCPS18D.WF-CP-RT1-ACT-DATE
*S** IF WFCPS18D.WF-CP-RT1-FY = ' '
*S** MOVE #CUR-T1-FY TO WFCPS18D.WF-CP-RT1-FY
*S** END-IF
*S** MOVE #INPUT-EFF-DATE-D TO WFCPS18D.WF-CP-RT1-RPT-DATE
*S** IF #REPORT-DISB
*S** MOVE #CUR-T1-DISB TO WFCPS18D.WF-CP-RT1-R-DISB
*S** END-IF
*S** /*
*S** /* Load export data
*S** ASSIGN WFFLE18D.#EXPORT-PROGRAM = 'TEACH'
*S** ASSIGN WFFLE18D.#EXPORT-AIDYEAR = ##AID-YEAR
*S** ASSIGN WFFLE18D.#EXPORT-FAO = ##FAO-ID
*S** ASSIGN WFFLE18D.#EXPORT-OPEID = WWTABLED.WW-OPE-ID
*S** /*
*S** MOVE WFISW18D.#SSN TO #E-ORIG-SSN
*S** IF WFISW18D.#DOB = MASK(YYYYMMDD)
*S** MOVE EDITED WFISW18D.#DOB TO #E-ORIG-DOB (EM=YYYYMMDD)
*S** END-IF
*S** MOVE WFISW18D.#NM-LAST TO #E-ORIG-LAST
*S** MOVE WFISW18D.#NM-FIRST TO #E-ORIG-FIRST
*S** MOVE WFISW18D.#NM-MI TO #E-ORIG-MI
*S** MOVE ##SID TO #E-ORIG-STUDENT-ID
*S** /*
*S** MOVE WFISW18D.#AD-STRT TO #E-ORIG-AD-STRT
*S** MOVE WFISW18D.#AD-CITY TO #E-ORIG-AD-CITY
*S** MOVE WFISW18D.#AD-STATE TO #E-ORIG-AD-STATE
*S** MOVE WFISW18D.#AD-ZIP TO #E-ORIG-AD-ZIP
*S** /*
*S** DECIDE FOR FIRST CONDITION
*S** WHEN WFFED18D.WF-FE-S-CIT = 'U'
*S** ASSIGN #E-ORIG-CIT = '1'
*S** WHEN WFFED18D.WF-FE-S-CIT = 'E'
*S** ASSIGN #E-ORIG-CIT = '2'
*S** WHEN NONE
*S** IGNORE
*S** END-DECIDE
*S** DECIDE FOR FIRST CONDITION
*S** WHEN #REPORT-ORIG AND NOT #REPORT-DISB
*S** MOVE 'ORIG' TO #E-ORIG-UPDATE
*S** WHEN NOT #REPORT-ORIG AND #REPORT-DISB
*S** MOVE 'DISB' TO #E-ORIG-UPDATE
*S** WHEN NONE
*S** MOVE 'BOTH' TO #E-ORIG-UPDATE
*S** END-DECIDE
*S** /*
*S** MOVE WFISW18D.#SSN TO #GID-SSN
*S** MOVE 'H' TO #GID-TYPE
*S** MOVE #AID-YY TO #GID-YEAR
*S** MOVE WWTABLED.WW-INST-ID TO #GID-SCHOOL
*S** MOVE 1 TO #GID-NUM
*S** /*
*S** MOVE #GRANT-ID TO #E-ORIG-GRANT-ID
*S** MOVE 1 TO #E-ORIG-GRANT-NUM
*S** /*
*S** MOVE WWSTDNCD.WW-ST-ATB-STATE TO #E-ORIG-ATB-STATE
*S** MOVE WWSTDNCD.WW-ST-ATB-CODE TO #E-ORIG-ATB-CODE
*S** MOVE WWSTDNCD.WW-ST-ATB-ADMN TO #E-ORIG-ATB-ADMN
*S** MOVE WWSTDNCD.WW-ST-ATB-TEST TO #E-ORIG-ATB-TEST
*S** MOVE WWSTDNCD.WW-ST-ATB-DATE TO #E-ORIG-ATB-DATE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #E-ORIG-FEDID-TRAN
*S** MOVE #CUR-T1-YR-COL TO #E-ORIG-YR-COL
*S** MOVE #CUR-T1-ENR-DATE TO #E-ORIG-ENR-DATE
*S** MOVE #CUR-T1-AWARD TO #E-ORIG-AWARD
*S** FOR #DSUB = 1 TO 12
*S** IF #RPT-T1-D-NUM(#DSUB) NE 0
*S** ADD 1 TO #ESUB
*S** MOVE #RPT-T1-D-NUM(#DSUB) TO #E-DISB-NUMBER(#ESUB)
*S** MOVE #RPT-T1-D-SEQ(#DSUB) TO #E-DISB-SEQ(#ESUB)
*S** MOVE #CUR-T1-D-DP(#DSUB) TO #E-DISB-DP(#ESUB)
*S** MOVE #RPT-T1-D-DIS(#DSUB) TO #E-DISB-AMOUNT(#ESUB)
*S** MOVE #RPT-T1-D-DATE(#DSUB) TO #E-DISB-DATE(#ESUB)
*S** MOVE #RPT-T1-D-REL(#DSUB) TO #E-DISB-REL(#ESUB)
*S** /*
*S** /* Term start date, enrollment,CIP and pgm length,etc.
*S** /*
*S** IF ##SCHED-DP(#DSUB) = #CUR-T1-D-DP(#DSUB)
*S** MOVE BY NAME WFFID18D.#EXPORT-DISBURSEMENT(#DSUB) TO
*S** WFFLE18D.#EXPORT-DISBURSEMENT(#ESUB)
*S** FOR #TERM-SUB = 1 TO 12
*S** IF ##SCHED-RT(#TERM-SUB) = ##SCHED-DP-RT(#DSUB)
*S** MOVE #WW-TERM-START-DATE(#TERM-SUB) TO
*S** WFFLE18D.#E-DISB-PAYPD-START-DATE(#ESUB)
*S** ESCAPE BOTTOM
*S** END-IF
*S** END-FOR
*S** END-IF
*S** END-IF
*S** END-FOR
*S** /*
*S** WRITE WORK FILE 2 WFFLE18D
*S** END-IF
*S**END-SUBROUTINE /* DECIDE-TO-REPORT-TEACH1
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE DECIDE-TO-REPORT-TEACH2
*S*************************************************************************
*S** /*
*S** /* If Runmode is not RECOVER, skip anyone who has a "hold" action;
*S** /* skip anyone who has been reported and the COD response has not
*S** /* been received and processed unless re-report has been requested;
*S** /* skip anyone who has no award and no previously-reported award
*S** /* If Runmode is RECOVER, skip anyone who was not reported
*S** /* on the Effective Date
*S** IF #INPUT-RUNMODE NE 'RECOVER' AND
*S** (WFCPS18D.WF-CP-RT2-ACT = 'H' OR
*S** (WFCPS18D.WF-CP-RT2-RPT-DATE > WFCPS18D.WF-CP-RT2-O-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT2-RPT-DATE > WFCPS18D.WF-CP-RT2-D-ACK-DATE AND
*S** WFCPS18D.WF-CP-RT2-ACT NE 'R') OR
*S** (#CUR-T2-AWARD = 0 AND WFCPS18D.WF-CP-RT2-A-AWARD = 0))
*S** ESCAPE ROUTINE
*S** END-IF
*S** IF #INPUT-RUNMODE = 'RECOVER'
*S** IF WFCPS18D.WF-CP-RT2-RPT-DATE NE #INPUT-EFF-DATE-D
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** /*
*S** RESET #REPORT-ORIG #REPORT-DISB #REPORT-ERROR
*S** RESET WFFLE18D #ESUB
*S** FOR #DISB-SUB = 1 TO 12
*S** IF #CUR-T2-D-DP(#DISB-SUB) <> ' ' AND
*S** (#CUR-T2-D-OFF(#DISB-SUB) <> 0 OR
*S** #CUR-T2-D-DIS(#DISB-SUB) <> 0)
*S** MOVE #CUR-T2-D-DP(#DISB-SUB) TO #SCHED-DP(#DISB-SUB)
*S** END-IF
*S** END-FOR
*S** PERFORM LOAD-INST-DATA
*S** /*
*S** /* Set up print line
*S** MOVE 'TEACH2' TO #PRT-GRANT #ERR-GRANT
*S** MOVE 'Orig' TO #PRT-RECTYPE #ERR-RECTYPE
*S** MOVE EDITED #CUR-T2-AWARD (EM=Z,ZZZ.99) TO #PRT-AMT
*S** MOVE EDITED #CUR-T2-AWARD (EM=Z,ZZZ.99) TO #ERR-AMT
*S** /*
*S** IF #CUR-T2-AWARD > 0
*S** IF NOT WFISW18D.#EXISTS
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'No ISIR' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF WFCPS18D.WF-CP-FED-ID = ' '
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Federal ID' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T2-YR-COL LT '1' OR
*S** #CUR-T2-YR-COL GT '7'
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Class level' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #CUR-T2-ENR-DATE = INIT-DATE
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'Enrollment date' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** /* Invalid ATB codes
*S** /* (03 & 05 retired)
*S** IF WWSTDNCD.WW-ST-ATB-CODE = ' ' OR
*S** (WWSTDNCD.WW-ST-ATB-CODE = '03' OR
*S** WWSTDNCD.WW-ST-ATB-CODE = '05')
*S** ASSIGN #REPORT-ERROR = TRUE
*S** MOVE 'ATB code' TO #ERR-COMMENT
*S** WRITE(2) #ERROR-LINE
*S** RESET #ERROR-LINE
*S** END-IF
*S** IF #REPORT-ERROR
*S** ESCAPE ROUTINE
*S** END-IF
*S** END-IF
*S** IF (#INPUT-RUNMODE = 'RECOVER' AND
*S** WFCPS18D.WF-CP-RT2-RPT-DATE = #INPUT-EFF-DATE-D) OR
*S** WFCPS18D.WF-CP-RT2-ACT = 'R' OR
*S** #CUR-T2-YR-COL NE WFCPS18D.WF-CP-RT2-A-YR-COL OR
*S** #CUR-T2-ENR-DATE NE WFCPS18D.WF-CP-RT2-A-ENR-DATE OR
*S** #CUR-T2-AWARD NE WFCPS18D.WF-CP-RT2-A-AWARD
*S** ASSIGN #REPORT-ORIG = TRUE
*S** ADD #CUR-T2-AWARD TO #T-AWRD-NET
*S** SUBTRACT WFCPS18D.WF-CP-RT2-A-AWARD FROM #T-AWRD-NET
*S** /*
*S** /* Move origination data to be reported to "report" CPS fields
*S** MOVE 2 TO WFCPS18D.WF-CP-RT2-R-GRANT
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO WFCPS18D.WF-CP-RT2-R-FED-TRAN
*S** MOVE #CUR-T2-YR-COL TO WFCPS18D.WF-CP-RT2-R-YR-COL
*S** MOVE #CUR-T2-ENR-DATE TO WFCPS18D.WF-CP-RT2-R-ENR-DATE
*S** MOVE #CUR-T2-AWARD TO WFCPS18D.WF-CP-RT2-R-AWARD
*S** /*
*S** /* Create origination event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-ORIGINATION
*S** MOVE #CUR-T2-YR-COL TO #EO-CLAS-VALUE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #EO-TRAN-VALUE
*S** MOVE EDITED #CUR-T2-AWARD (EM=ZZ,ZZ9) TO #EO-AWRD-VALUE
*S** MOVE #EVENT-ORIG TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-IF
*S** /*
*S** /* Clear any old reported/unacknowledged data
*S** RESET #RPT-T2-D-NUM(*) #RPT-T2-D-SEQ(*)
*S** #RPT-T2-D-DIS(*) #RPT-T2-D-DATE(*) #RPT-T2-D-REL(*)
*S** /*
*S** /* Cycle through disbursements
*S** FOR #SUB = 1 TO 12
*S** IF #CUR-T2-D-DP(#SUB) = ' ' AND
*S** #ACK-T2-D-NUM(#SUB) = 0
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* If previously reported and nothing has changed, skip
*S** IF (#ACK-T2-D-REL(#SUB) = 'Y' AND
*S** #CUR-T2-D-DIS(#SUB) = #ACK-T2-D-DIS(#SUB)) OR
*S** (#ACK-T2-D-REL(#SUB) NE 'Y' AND
*S** #CUR-T2-D-OFF(#SUB) = #ACK-T2-D-DIS(#SUB) AND
*S** #CUR-T2-D-DIS(#SUB) = 0)
*S** ESCAPE TOP
*S** END-IF
*S** /*
*S** /* Set up print line
*S** MOVE 'Disb' TO #PRT-RECTYPE
*S** MOVE EDITED #CUR-T2-D-DIS(#SUB) (EM=Z,ZZZ.99) TO #PRT-AMT
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #PRT-COMMENT
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #PRT-COMMENT
*S** END-IF
*S** /*
*S** ASSIGN #REPORT-DISB = TRUE
*S** IF #ACK-T2-D-REL(#SUB) = 'Y' OR
*S** #CUR-T2-D-DIS(#SUB) > 0
*S** ADD #CUR-T2-D-DIS(#SUB) TO #T-DISB-TOTAL
*S** ELSE
*S** ADD #CUR-T2-D-OFF(#SUB) TO #T-DISB-TOTAL
*S** END-IF
*S** ADD #CUR-T2-D-DIS(#SUB) TO #T-DISB-NET
*S** SUBTRACT #ACK-T2-D-DIS(#SUB) FROM #T-DISB-NET
*S** /*
*S** /* Move disbursements to be reported to "report" fields in array
*S** IF #ACK-T2-D-NUM(#SUB) = 0
*S** RESET #HOLD-NUM
*S** FOR #DSUB = 1 TO 12
*S** IF #ACK-T2-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #ACK-T2-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** IF #RPT-T2-D-NUM(#DSUB) > #HOLD-NUM
*S** MOVE #RPT-T2-D-NUM(#DSUB) TO #HOLD-NUM
*S** END-IF
*S** END-FOR
*S** COMPUTE #RPT-T2-D-NUM(#SUB) = #HOLD-NUM + 1
*S** MOVE 1 TO #RPT-T2-D-SEQ(#SUB)
*S** ELSE
*S** MOVE #ACK-T2-D-NUM(#SUB) TO #RPT-T2-D-NUM(#SUB)
*S** IF #ACK-T2-D-REL(#SUB) = 'Y'
*S** COMPUTE #RPT-T2-D-SEQ(#SUB) = #ACK-T2-D-SEQ(#SUB) + 1
*S** ELSE
*S** MOVE 1 TO #RPT-T2-D-SEQ(#SUB)
*S** END-IF
*S** END-IF
*S** IF #ACK-T2-D-REL(#SUB) = 'Y' OR
*S** #CUR-T2-D-DIS(#SUB) > 0
*S** MOVE #CUR-T2-D-DIS(#SUB) TO #RPT-T2-D-DIS(#SUB)
*S** MOVE 'Y' TO #RPT-T2-D-REL(#SUB)
*S** ELSE
*S** MOVE #CUR-T2-D-OFF(#SUB) TO #RPT-T2-D-DIS(#SUB)
*S** MOVE 'N' TO #RPT-T2-D-REL(#SUB)
*S** END-IF
*S** IF #CUR-T2-D-DATE(#SUB) = INIT-DATE
*S** MOVE #ACK-T2-D-DATE(#SUB) TO #RPT-T2-D-DATE(#SUB)
*S** ELSE
*S** MOVE #CUR-T2-D-DATE(#SUB) TO #RPT-T2-D-DATE(#SUB)
*S** END-IF
*S** /*
*S** /* Create disbursement event
*S** MOVE 'TGRpt' TO #EVENT-TYPE
*S** RESET INITIAL #EVENT-DISBURSEMENT
*S** MOVE EDITED #RPT-T2-D-NUM(#SUB) (EM=99) TO #ED-DSBN-VALUE
*S** MOVE EDITED #RPT-T2-D-SEQ(#SUB) (EM=99) TO #ED-SEQN-VALUE
*S** IF ##SCHED-DP-TITLE(#SUB) = ' '
*S** MOVE 'CODRptErr' TO #ED-DPNM-VALUE
*S** ELSE
*S** MOVE ##SCHED-DP-TITLE(#SUB) TO #ED-DPNM-VALUE
*S** END-IF
*S** MOVE EDITED #RPT-T2-D-DIS(#SUB) (EM=ZZ,ZZ9) TO #ED-DSBV-VALUE
*S** MOVE #EVENT-DISB TO #EVENT-DESC
*S** PERFORM ADD-EVENT #EVENT-TYPE #EVENT-DESC
*S** /*
*S** /* Print on report of processed records
*S** WRITE(3) #PRINT-LINE
*S** RESET #PRINT-LINE
*S** END-FOR
*S** /*
*S** IF #REPORT-ORIG OR #REPORT-DISB
*S** ASSIGN #REPORT-TEACH = TRUE
*S** ADD 1 TO #T-STNT-COUNT
*S** ADD #CUR-T2-AWARD TO #T-AWRD-TOTAL
*S** /*
*S** /* Load CPS data
*S** RESET WFCPS18D.WF-CP-RT2-ACT
*S** WFCPS18D.WF-CP-RT2-ACT-RSN
*S** WFCPS18D.WF-CP-RT2-ACT-DATE
*S** IF WFCPS18D.WF-CP-RT2-FY = ' '
*S** MOVE #CUR-T2-FY TO WFCPS18D.WF-CP-RT2-FY
*S** END-IF
*S** MOVE #INPUT-EFF-DATE-D TO WFCPS18D.WF-CP-RT2-RPT-DATE
*S** IF #REPORT-DISB
*S** MOVE #CUR-T2-DISB TO WFCPS18D.WF-CP-RT2-R-DISB
*S** END-IF
*S** /*
*S** /* Load export data
*S** ASSIGN WFFLE18D.#EXPORT-PROGRAM = 'TEACH'
*S** ASSIGN WFFLE18D.#EXPORT-AIDYEAR = ##AID-YEAR
*S** ASSIGN WFFLE18D.#EXPORT-FAO = ##FAO-ID
*S** ASSIGN WFFLE18D.#EXPORT-OPEID = WWTABLED.WW-OPE-ID
*S** /*
*S** MOVE WFISW18D.#SSN TO #E-ORIG-SSN
*S** IF WFISW18D.#DOB = MASK(YYYYMMDD)
*S** MOVE EDITED WFISW18D.#DOB TO #E-ORIG-DOB (EM=YYYYMMDD)
*S** END-IF
*S** MOVE WFISW18D.#NM-LAST TO #E-ORIG-LAST
*S** MOVE WFISW18D.#NM-FIRST TO #E-ORIG-FIRST
*S** MOVE WFISW18D.#NM-MI TO #E-ORIG-MI
*S** MOVE ##SID TO #E-ORIG-STUDENT-ID
*S** /*
*S** MOVE WFISW18D.#AD-STRT TO #E-ORIG-AD-STRT
*S** MOVE WFISW18D.#AD-CITY TO #E-ORIG-AD-CITY
*S** MOVE WFISW18D.#AD-STATE TO #E-ORIG-AD-STATE
*S** MOVE WFISW18D.#AD-ZIP TO #E-ORIG-AD-ZIP
*S** /*
*S** DECIDE FOR FIRST CONDITION
*S** WHEN WFFED18D.WF-FE-S-CIT = 'U'
*S** ASSIGN #E-ORIG-CIT = '1'
*S** WHEN WFFED18D.WF-FE-S-CIT = 'E'
*S** ASSIGN #E-ORIG-CIT = '2'
*S** WHEN NONE
*S** IGNORE
*S** END-DECIDE
*S** DECIDE FOR FIRST CONDITION
*S** WHEN #REPORT-ORIG AND NOT #REPORT-DISB
*S** MOVE 'ORIG' TO #E-ORIG-UPDATE
*S** WHEN NOT #REPORT-ORIG AND #REPORT-DISB
*S** MOVE 'DISB' TO #E-ORIG-UPDATE
*S** WHEN NONE
*S** MOVE 'BOTH' TO #E-ORIG-UPDATE
*S** END-DECIDE
*S** /*
*S** MOVE WFISW18D.#SSN TO #GID-SSN
*S** MOVE 'H' TO #GID-TYPE
*S** MOVE #AID-YY TO #GID-YEAR
*S** MOVE WWTABLED.WW-INST-ID TO #GID-SCHOOL
*S** MOVE 2 TO #GID-NUM
*S** /*
*S** MOVE #GRANT-ID TO #E-ORIG-GRANT-ID
*S** MOVE 2 TO #E-ORIG-GRANT-NUM
*S** /*
*S** MOVE WWSTDNCD.WW-ST-ATB-STATE TO #E-ORIG-ATB-STATE
*S** MOVE WWSTDNCD.WW-ST-ATB-CODE TO #E-ORIG-ATB-CODE
*S** MOVE WWSTDNCD.WW-ST-ATB-ADMN TO #E-ORIG-ATB-ADMN
*S** MOVE WWSTDNCD.WW-ST-ATB-TEST TO #E-ORIG-ATB-TEST
*S** MOVE WWSTDNCD.WW-ST-ATB-DATE TO #E-ORIG-ATB-DATE
*S** MOVE WFCPS18D.WF-CP-FED-ID3 TO #E-ORIG-FEDID-TRAN
*S** MOVE #CUR-T2-YR-COL TO #E-ORIG-YR-COL
*S** MOVE #CUR-T2-ENR-DATE TO #E-ORIG-ENR-DATE
*S** MOVE #CUR-T2-AWARD TO #E-ORIG-AWARD
*S** FOR #DSUB = 1 TO 12
*S** IF #RPT-T2-D-NUM(#DSUB) NE 0
*S** ADD 1 TO #ESUB
*S** MOVE #RPT-T2-D-NUM(#DSUB) TO #E-DISB-NUMBER(#ESUB)
*S** MOVE #RPT-T2-D-SEQ(#DSUB) TO #E-DISB-SEQ(#ESUB)
*S** MOVE #CUR-T2-D-DP(#DSUB) TO #E-DISB-DP(#ESUB)
*S** MOVE #RPT-T2-D-DIS(#DSUB) TO #E-DISB-AMOUNT(#ESUB)
*S** MOVE #RPT-T2-D-DATE(#DSUB) TO #E-DISB-DATE(#ESUB)
*S** MOVE #RPT-T2-D-REL(#DSUB) TO #E-DISB-REL(#ESUB)
*S** /*
*S** /* Term start date, enrollment and cip
*S** /*
*S** IF ##SCHED-DP(#DSUB) = #CUR-T1-D-DP(#DSUB)
*S** MOVE BY NAME WFFID18D.#EXPORT-DISBURSEMENT(#DSUB) TO
*S** WFFLE18D.#EXPORT-DISBURSEMENT(#ESUB)
*S** FOR #TERM-SUB = 1 TO 12
*S** IF ##SCHED-RT(#TERM-SUB) = ##SCHED-DP-RT(#DSUB)
*S** MOVE #WW-TERM-START-DATE(#TERM-SUB) TO
*S** WFFLE18D.#E-DISB-PAYPD-START-DATE(#ESUB)
*S** ESCAPE BOTTOM
*S** END-IF
*S** END-FOR
*S** END-IF
*S** END-IF
*S** END-FOR
*S** WRITE WORK FILE 2 WFFLE18D
*S** END-IF
*S**END-SUBROUTINE /* DECIDE-TO-REPORT-TEACH2
*S*************************************************************************
*S**DEFINE SUBROUTINE LOAD-INST-DATA
*S*************************************************************************
*S** /* Retrieve Teach Export data from outside of Financier
*S** CALLNAT 'WFFID18N' WW-GDA
*S** #FID-TYPE
*S** #FID-FUNCTION
*S** #SCHED-DP(*)
*S** WFFID18D
*S** /* Move instituional data from PDA to Grant data PDA
*S** MOVE BY NAME WFFID18D TO WFFLE18D
*S***
*S**END-SUBROUTINE /* LOAD-INST-DATA
*S***
*S*************************************************************************
*S**DEFINE SUBROUTINE GET-TERM-BEG-DATES
*S*************************************************************************
*S** /* Get calendar for student's schedule
*S** ASSIGN WWCALEND.WW-RECORD-TYPE = TABLE-TYPE
*S** ASSIGN WWCALEND.WW-TABLE-ID = 'CALEN' /* Calendar table
*S** MOVE ##AID-YEAR TO #CAL-AY
*S** MOVE ##FAO-ID TO #CAL-FAO
*S** MOVE ##SCHED-ID TO #CAL-SCHED
*S** ASSIGN WWCALEND.WW-TABLE-VALUE = #CAL-TBL-VAL
*S** ASSIGN WWAOBJ.#FUNCTION = 'GET'
*S** CALLNAT 'WWCALENO' WW-GDA
*S** WWCALEND
*S** WWCALEND-ID
*S** WWCALENR
*S** WWAOBJ
*S** MOVE BY NAME WWCALEND TO #WW-CALENDAR
*S** /*
*S**END-SUBROUTINE /* GET-TERM-BEG-DATES
*S***
*S**END
*E
Number of differences: 1
Added(0,2)
Deleted(0,0)
Changed(1)
Changed in changed(1)
Ignored