00001  IDENTIFICATION DIVISION.                                         10/03/11
00002  PROGRAM-ID.             DTSBD180.                                DTSBD180
00003  AUTHOR.                 TRICOASTAL CONSULTING LTD.                  LV019
00004  DATE-WRITTEN.           JANUARY 1991.                            DTSBD180
00005  DATE-COMPILED.                                                   DTSBD180
00006      SKIP3                                                        DTSBD180
00007 *****                                                             DTSBD180
00008 *                                                                 DTSBD180
00009 *    FUNCTION:  POST-UPDATE ACCOUNTING TRANSACTION COLLECTION     DTSBD180
00010 *               FILE SCAN.                                        DTSBD180
00011 *                                                                 DTSBD180
00012 *    MODIFICATION LOG:                                            DTSBD180
00013 *                                                                 DTSBD180
00014 *    01/06/92  INITIAL DEVELOPMENT.                               DTSBD180
00015 *              WORK ORDER:                      PROGRAMMER: TCL   DTSBD180
00016 *                                                                 DTSBD180
00017 *    05/09/95  AHDR-*-ITEM-CNT  WERE CHANGED TO  AHDR-*-TRAN-CNT. DTSBD180
00018 *              THEY NO LONGER INCLUDE THE CHECKS IN THE COUNTS.   DTSBD180
00019 *              WORK ORDER: CR076                PROGRAMMER: RHC   DTSBD180
00020 *                                                                 DTSBD180
00021 *    12/31/96  ADDED 88 LEVEL TO DTSIAHDR FOR ELECTRONIC FILER    DTSBD180
00022 *              BATCHES.  ONLY USEDIN DTSBD140, SO TO SAVE MONEY   DTSBD180
00023 *              THIS PROGRAM WASN'T RECOMPILED.                    DTSBD180
00024 *              WORK ORDER:                      PROGRAMMER: MJA   DTSBD180
00025 *                                                                 DTSBD180
00026 *    10/10/1998  REVIEWED AND MODIFIED FOR DC.  IN DC,            DTSBD180
00027 *                ACCOUNTING TRANSACTIONS IN A GIVEN BATCH ARE     DTSBD180
00028 *                RETAINED ON THE ATC UNTIL ALL ACCOUNTING         DTSBD180
00029 *                TRANSACTIONS IN THE BATCH SUCCESSFULLY PROCESSED DTSBD180
00030 *                BY THE ACCOUNTING UPDATE - WHEN ALL THE          DTSBD180
00031 *                ACCOUNTING TRANSACTIONS IN THE BATCH ARE         DTSBD180
00032 *                DELETED FROM THE ATC BY DTSBD180.  HENCE,        DTSBD180
00033 *                DTSBD180 ESSENTIALLY REWRITTEN FOR DC.           DTSBD180
00034 *                REFERENCE: DC DEVELOPMENT      PROGRAMMER: EHH   DTSBD180
00035 *                                                                 DTSBD180
00036 *    01/28/2002  MODIFIED FOR ANNUAL REPORT TRANSACTION (DTSIAATX)DTSBD180
00037 *                REFERENCE: HOUSEHOLD           PROGRAMMER: GD    DTSBD180
00038 *                                                                 DTSBD180
00039 *    12/07/2005  ADDED BANK BATCH NUMBER.                         DTSBD180
00040 *                REFERENCE:                     PROGRAMMER: GD    DTSBD180
00041 *                                                                 DTSBD180
00042 *    07/08/2011  MODIFIED TO WRITE BATCH HEADER DATA FOR          DTSBD180
00043 *                SQL SERVER DATABASE.                             DTSBD180
00044 *                REFERENCE:                     PROGRAMMER: GD    DTSBD180
00045 *                                                                 DTSBD180
00046 *    09/29/2011  MODIFIED SELECTION PROCESS FOR BX217 EXPORT FILE.DTSBD180
00047 *                THE PROCESS THAT BUILDS THE FILE IS NOW CALLED   DTSBD180
00048 *                AFTER THE CALL TO P4000 - THAT WAS NECESSARY TO  DTSBD180
00049 *                GET THE UPDATED VALUES FOR THE PROCESSED FIELDS. DTSBD180
00050 *                THE PROGRAM ALSO SELECTS ALL BATCHES THAT APPEAR DTSBD180
00051 *                IN THE 301 REPORT - PREVIOUSLY IT ONLY SELECTED  DTSBD180
00052 *                BATCHES THAT WERE NEW OR HAD BEEN UPDATED        DTSBD180
00053 *                ON THE 21 SCREEN.                                DTSBD180
00054 *                REFERENCE:                     PROGRAMMER: GD    DTSBD180
00055 *                                                                 DTSBD180
00056 *                                                                 DTSBD180
00057 *                                                                 DTSBD180
00058 *  DESCRIPTION:                                                   DTSBD180
00059 *                                                                 DTSBD180
00060 *    INITIATION:                                                  DTSBD180
00061 *                                                                 DTSBD180
00062 *      OPEN MASTER FILE (L910-OPEN-READ-88).                      DTSBD180
00063 *      OPEN ATC FILE (L923-OPEN-UPDATE-88).                       DTSBD180
00064 *                                                                 DTSBD180
00065 *      READ THE MHDR RECORD.                                      DTSBD180
00066 *      IF L910-NO-REC-88                                          DTSBD180
00067 *          ABEND THE MODULE.                                      DTSBD180
00068 *                                                                 DTSBD180
00069 *      MOVE MHDR-PRIOR-RUN-DATE TO R301-CURR-RUN-DATE.            DTSBD180
00070 *                                                                 DTSBD180
00071 *      MOVE +0 TO WORKING STORAGE COUNTERS.                       DTSBD180
00072 *                                                                 DTSBD180
00073 *                                                                 DTSBD180
00074 *    PROCESSING:                                                  DTSBD180
00075 *                                                                 DTSBD180
00076 *      FOR EACH AHDR RECORD ON THE ATC FILE:                      DTSBD180
00077 *                                                                 DTSBD180
00078 *      IF AHDR-BATCH-BALANCED-NO-88 OR AHDR-BATCH-HELD-YES-88     DTSBD180
00079 *          WRITE A R301 RECORD (WITH R301 FIELDS POPULATED FROM   DTSBD180
00080 *          AHDR FIELDS)                                           DTSBD180
00081 *      ELSE                                                       DTSBD180
00082 *          SCAN THRU THE ATC FILE, SUMMING PROCESSED AND NOT      DTSBD180
00083 *          PROCESSED TRANSACTIONS IN THIS BATCH;                  DTSBD180
00084 *          WRITE A R301 RECORD;                                   DTSBD180
00085 *          IF UNPROCESEED TRANSACTION RECORDS IN THIS BATCH       DTSBD180
00086 *             EXIST ON THE ATC FILE                               DTSBD180
00087 *              RESET AHDR FIELDS AND REWRITE THE AHDR RECORD      DTSBD180
00088 *          ELSE                                                   DTSBD180
00089 *              DELETE THE AHDR RECORD AND ALL ASSOCIATED          DTSBD180
00090 *              TRANSACTIONS.                                      DTSBD180
00091 *                                                                 DTSBD180
00092 *                                                                 DTSBD180
00093 *    TERMINATION:                                                 DTSBD180
00094 *                                                                 DTSBD180
00095 *      DISPLAY THE MODULE TERMINATION STATISTICS.                 DTSBD180
00096 *                                                                 DTSBD180
00097 *      CLOSE MASTER FILE, ATC FILE, S946-RPT-REC-O FILE.          DTSBD180
00098 *                                                                 DTSBD180
00099 *                                                                 DTSBD180
00100 *****                                                             DTSBD180
00101      SKIP3                                                        DTSBD180
00102  ENVIRONMENT DIVISION.                                            DTSBD180
00103  INPUT-OUTPUT SECTION.                                            DTSBD180
00104                                                                   DTSBD180
00105  FILE-CONTROL.                                                    DTSBD180
00106      SELECT BX217-BATCH-FILE       ASSIGN TO DTSFX217             DTSBD180
00107             FILE STATUS IS BX217-STATUS.                          DTSBD180
00108                                                                   DTSBD180
00109      SKIP3                                                        DTSBD180
00110  DATA DIVISION.                                                   DTSBD180
00111  FILE SECTION.                                                    DTSBD180
00112                                                                   DTSBD180
00113  FD  BX217-BATCH-FILE                                             DTSBD180
00114      RECORDING MODE IS F                                          DTSBD180
00115      BLOCK CONTAINS 0 RECORDS                                     DTSBD180
00116      LABEL RECORDS ARE OMITTED.                                   DTSBD180
00117                                                                   DTSBD180
00118  01  BX217-REC               PIC X(148).                          DTSBD180
00119      SKIP3                                                        DTSBD180
00120  WORKING-STORAGE SECTION.                                         DTSBD180
001205 77  PAN-VALET PICTURE X(24) VALUE '019DTSBD180  10/03/11'.       DTSBD180
00121      SKIP3                                                        DTSBD180
00122  01  WRK-AREA.                                                    DTSBD180
00123      05  WRK-ABEND-CD                PIC S9(04)  COMP  VALUE +180.DTSBD180
00124                                                                   DTSBD180
00125      05  WRK-MODULE-ID               PIC  X(08)  VALUE 'DTSBD180'.DTSBD180
00126                                                                   DTSBD180
00127      05  BX217-STATUS                    PIC  X(02).              DTSBD180
00128          88  BX217-STATUS-OK-88            VALUE '00'.            DTSBD180
00129                                                                   DTSBD180
00130      05  WRK-AHDR-REC-CNT                PIC S9(07)       COMP-3. DTSBD180
00131                                                                   DTSBD180
00132      05  WRK-AHDR-BALANCED-CNT           PIC S9(07)       COMP-3. DTSBD180
00133                                                                   DTSBD180
00134      05  WRK-AHDR-NOT-BALANCED-CNT       PIC S9(07)       COMP-3. DTSBD180
00135                                                                   DTSBD180
00136      05  WRK-AHDR-HELD-CNT               PIC S9(07)       COMP-3. DTSBD180
00137                                                                   DTSBD180
00138      05  WRK-AHDR-NOT-HELD-CNT           PIC S9(07)       COMP-3. DTSBD180
00139                                                                   DTSBD180
00140      05  WRK-AHDR-PROCESSED-CNT          PIC S9(07)       COMP-3. DTSBD180
00141                                                                   DTSBD180
00142      05  WRK-AHDR-BYPASSED-CNT           PIC S9(07)       COMP-3. DTSBD180
00143                                                                   DTSBD180
00144      05  WRK-AHDR-DELETED-CNT            PIC S9(07)       COMP-3. DTSBD180
00145                                                                   DTSBD180
00146      05  WRK-AHDR-RETAINED-CNT           PIC S9(07)       COMP-3. DTSBD180
00147                                                                   DTSBD180
00148      05  WRK-R301-REC-CNT                PIC S9(07)       COMP-3. DTSBD180
00149                                                                   DTSBD180
00150      05  WRK-X217-REC-CNT                PIC S9(07)       COMP-3. DTSBD180
00151                                                                   DTSBD180
00152                                                                   DTSBD180
00153      05  WRK-PROCESSED-TRAN-CNT          PIC S9(03)       COMP-3. DTSBD180
00154                                                                   DTSBD180
00155      05  WRK-PROCESSED-REMIT-AMT         PIC S9(09)V9(02) COMP-3. DTSBD180
00156                                                                   DTSBD180
00157      05  WRK-NOT-PROCESSED-TRAN-CNT      PIC S9(03)       COMP-3. DTSBD180
00158                                                                   DTSBD180
00159      05  WRK-NOT-PROCESSED-REMIT-AMT     PIC S9(09)V9(02) COMP-3. DTSBD180
00160                                                                   DTSBD180
00161                                                                   DTSBD180
00162                                                                   DTSBD180
00163  01  WRK-INDICATORS.                                              DTSBD180
00164      05  ATC-BATCH-BREAK-IND             PIC  X(01).              DTSBD180
00165                                                                   DTSBD180
00166                                                                   DTSBD180
00167                                                                   DTSBD180
00168  01  WRK-HOLD-FIELDS.                                             DTSBD180
00169      05  WRK-R301-RUN-DATE               PIC S9(09)       COMP-3. DTSBD180
00170      EJECT                                                        DTSBD180
00171  01  L001-LINK-AREA.                                              DTSBD180
00172  ++INCLUDE DTSIL001                                               DTSBD180
00173      SKIP3                                                        DTSBD180
00174  01  L910-LINK-AREA.                                              DTSBD180
00175  ++INCLUDE DTSIL910                                               DTSBD180
00176      SKIP3                                                        DTSBD180
00177  01  MSKL-REC.                                                    DTSBD180
00178  ++INCLUDE DTSIMSKL                                               DTSBD180
00179      SKIP3                                                        DTSBD180
00180  01  MHDR-REC.                                                    DTSBD180
00181  ++INCLUDE DTSIMHDR                                               DTSBD180
00182      EJECT                                                        DTSBD180
00183  01  L923-LINK-AREA.                                              DTSBD180
00184  ++INCLUDE DTSIL923                                               DTSBD180
00185      SKIP3                                                        DTSBD180
00186  01  ASKL-REC.                                                    DTSBD180
00187  ++INCLUDE DTSIASKL                                               DTSBD180
00188      SKIP3                                                        DTSBD180
00189  01  AHDR-REC.                                                    DTSBD180
00190  ++INCLUDE DTSIAHDR                                               DTSBD180
00191      SKIP3                                                        DTSBD180
00192  01  ARPT-REC.                                                    DTSBD180
00193  ++INCLUDE DTSIARPT                                               DTSBD180
00194      SKIP3                                                        DTSBD180
00195  01  AATX-REC.                                                    DTSBD180
00196  ++INCLUDE DTSIAATX                                               DTSBD180
00197      SKIP3                                                        DTSBD180
00198  01  APAY-REC.                                                    DTSBD180
00199  ++INCLUDE DTSIAPAY                                               DTSBD180
00200      SKIP3                                                        DTSBD180
00201  01  AADJ-REC.                                                    DTSBD180
00202  ++INCLUDE DTSIAADJ                                               DTSBD180
00203      EJECT                                                        DTSBD180
00204  01  R301-REC.                                                    DTSBD180
00205  ++INCLUDE DTSIR301                                               DTSBD180
00206      EJECT                                                        DTSBD180
00207  01  WRK-X217-REC.                                                DTSBD180
00208  ++INCLUDE DTSIX217                                               DTSBD180
00209      EJECT                                                        DTSBD180
00210  PROCEDURE DIVISION.                                              DTSBD180
00211                                                                   DTSBD180
00212                                                                   DTSBD180
00213      PERFORM I0000-INITIATE THRU I0000-EXIT.                      DTSBD180
00214                                                                   DTSBD180
00215      PERFORM P0000-PROCESS THRU P0000-EXIT.                       DTSBD180
00216                                                                   DTSBD180
00217      PERFORM T0000-TERMINATE THRU T0000-EXIT.                     DTSBD180
00218                                                                   DTSBD180
00219                                                                   DTSBD180
00220      GOBACK.                                                      DTSBD180
00221      EJECT                                                        DTSBD180
00222  I0000-INITIATE.                                                  DTSBD180
00223      PERFORM I1000-OPEN-FILES THRU I1000-EXIT.                    DTSBD180
00224                                                                   DTSBD180
00225      PERFORM I2000-INITIALIZE-WRK THRU I2000-EXIT.                DTSBD180
00226                                                                   DTSBD180
00227      MOVE LENGTH OF R301-REC TO R301-LENGTH.                      DTSBD180
00228  I0000-EXIT.                                                      DTSBD180
00229      EXIT.                                                        DTSBD180
00230      EJECT                                                        DTSBD180
00231  I1000-OPEN-FILES.                                                DTSBD180
00232      PERFORM S910-OPEN-READ THRU S910-EXIT.                       DTSBD180
00233                                                                   DTSBD180
00234      PERFORM S923-OPEN-UPDATE THRU S923-EXIT.                     DTSBD180
00235                                                                   DTSBD180
00236      OPEN OUTPUT BX217-BATCH-FILE.                                DTSBD180
00237      IF NOT BX217-STATUS-OK-88                                    DTSBD180
00238         DISPLAY 'CANNOT OPEN BX217 FILE ' BX217-STATUS            DTSBD180
00239         PERFORM S999-ABEND    THRU S999-EXIT                      DTSBD180
00240      END-IF.                                                      DTSBD180
00241                                                                   DTSBD180
00242  I1000-EXIT.                                                      DTSBD180
00243      EXIT.                                                        DTSBD180
00244      EJECT                                                        DTSBD180
00245  I2000-INITIALIZE-WRK.                                            DTSBD180
00246      MOVE +0 TO WRK-AHDR-REC-CNT                                  DTSBD180
00247                 WRK-AHDR-BALANCED-CNT                             DTSBD180
00248                 WRK-AHDR-NOT-BALANCED-CNT                         DTSBD180
00249                 WRK-AHDR-HELD-CNT                                 DTSBD180
00250                 WRK-AHDR-NOT-HELD-CNT                             DTSBD180
00251                 WRK-AHDR-PROCESSED-CNT                            DTSBD180
00252                 WRK-AHDR-BYPASSED-CNT                             DTSBD180
00253                 WRK-AHDR-DELETED-CNT                              DTSBD180
00254                 WRK-AHDR-RETAINED-CNT                             DTSBD180
00255                 WRK-R301-REC-CNT                                  DTSBD180
00256                 WRK-X217-REC-CNT.                                 DTSBD180
00257                                                                   DTSBD180
00258                                                                   DTSBD180
00259      MOVE LOW-VALUES TO MHDR-KEY-AREA.                            DTSBD180
00260                                                                   DTSBD180
00261      MOVE +0 TO MHDR-EMP-NO.                                      DTSBD180
00262                                                                   DTSBD180
00263      SET MHDR-HDR-88 TO TRUE.                                     DTSBD180
00264                                                                   DTSBD180
00265      MOVE MHDR-KEY-AREA TO MSKL-KEY-AREA.                         DTSBD180
00266                                                                   DTSBD180
00267      PERFORM S910-READ THRU S910-EXIT.                            DTSBD180
00268                                                                   DTSBD180
00269      IF L910-NO-REC-88                                            DTSBD180
00270         PERFORM S999-ABEND THRU S999-EXIT.                        DTSBD180
00271                                                                   DTSBD180
00272      MOVE MSKL-REC TO MHDR-REC.                                   DTSBD180
00273                                                                   DTSBD180
00274      MOVE MHDR-PRIOR-RUN-DATE TO WRK-R301-RUN-DATE.               DTSBD180
00275  I2000-EXIT.                                                      DTSBD180
00276      EXIT.                                                        DTSBD180
00277      EJECT                                                        DTSBD180
00278  P0000-PROCESS.                                                   DTSBD180
00279      MOVE +0 TO AHDR-BATCH-NO                                     DTSBD180
00280                 AHDR-ITEM-NO.                                     DTSBD180
00281                                                                   DTSBD180
00282      PERFORM P1000-ATC-FILE THRU P1000-EXIT                       DTSBD180
00283         UNTIL L923-NO-REC-88.                                     DTSBD180
00284  P0000-EXIT.                                                      DTSBD180
00285      EXIT.                                                        DTSBD180
00286      EJECT                                                        DTSBD180
00287  P1000-ATC-FILE.                                                  DTSBD180
00288      ADD +1 TO AHDR-BATCH-NO.                                     DTSBD180
00289                                                                   DTSBD180
00290      MOVE AHDR-KEY-AREA TO ASKL-KEY-AREA.                         DTSBD180
00291                                                                   DTSBD180
00292      PERFORM S923-START-BROWSE THRU S923-EXIT.                    DTSBD180
00293                                                                   DTSBD180
00294      IF L923-NO-REC-88                                            DTSBD180
00295          GO TO P1000-EXIT.                                        DTSBD180
00296                                                                   DTSBD180
00297                                                                   DTSBD180
00298      IF NOT ASKL-HDR-88                                           DTSBD180
00299          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBD180
00300                                                                   DTSBD180
00301                                                                   DTSBD180
00302      MOVE ASKL-REC TO AHDR-REC.                                   DTSBD180
00303                                                                   DTSBD180
00304                                                                   DTSBD180
00305      ADD +1 TO WRK-AHDR-REC-CNT.                                  DTSBD180
00306                                                                   DTSBD180
00307      IF AHDR-BATCH-BALANCED-YES-88                                DTSBD180
00308          ADD +1 TO WRK-AHDR-BALANCED-CNT                          DTSBD180
00309      ELSE                                                         DTSBD180
00310          ADD +1 TO WRK-AHDR-NOT-BALANCED-CNT.                     DTSBD180
00311                                                                   DTSBD180
00312      IF AHDR-BATCH-HELD-NO-88                                     DTSBD180
00313          ADD +1 TO WRK-AHDR-NOT-HELD-CNT                          DTSBD180
00314      ELSE                                                         DTSBD180
00315          ADD +1 TO WRK-AHDR-HELD-CNT.                             DTSBD180
00316                                                                   DTSBD180
00317                                                                   DTSBD180
00318      MOVE 'N' TO ATC-BATCH-BREAK-IND.                             DTSBD180
00319                                                                   DTSBD180
00320      MOVE +0 TO WRK-PROCESSED-TRAN-CNT                            DTSBD180
00321                 WRK-PROCESSED-REMIT-AMT                           DTSBD180
00322                 WRK-NOT-PROCESSED-TRAN-CNT                        DTSBD180
00323                 WRK-NOT-PROCESSED-REMIT-AMT.                      DTSBD180
00324                                                                   DTSBD180
00325      PERFORM P2000-ATC-DETAIL THRU P2000-EXIT                     DTSBD180
00326         UNTIL L923-NO-REC-88  OR                                  DTSBD180
00327               ATC-BATCH-BREAK-IND = 'Y'.                          DTSBD180
00328                                                                   DTSBD180
00329                                                                   DTSBD180
00330      PERFORM P3000-GENERATE-R301-REC    THRU P3000-EXIT.          DTSBD180
00331                                                                   DTSBD180
00332 **   IF AHDR-ESTB-DATE = WRK-R301-RUN-DATE                        DTSBD180
00333 *    OR AHDR-CHNG-DATE = WRK-R301-RUN-DATE                        DTSBD180
00334 *       PERFORM P3200-GENERATE-X217-REC    THRU P3200-EXIT        DTSBD180
00335 **   END-IF.                                                      DTSBD180
00336                                                                   DTSBD180
00337      IF AHDR-BATCH-BALANCED-YES-88 AND AHDR-BATCH-HELD-NO-88      DTSBD180
00338         ADD +1 TO WRK-AHDR-PROCESSED-CNT                          DTSBD180
00339         PERFORM P4000-PROCESSED-BATCH THRU P4000-EXIT             DTSBD180
00340      ELSE                                                         DTSBD180
00341         ADD +1 TO WRK-AHDR-BYPASSED-CNT                           DTSBD180
00342         ADD +1 TO WRK-AHDR-RETAINED-CNT                           DTSBD180
00343      END-IF.                                                      DTSBD180
00344                                                                   DTSBD180
00345      PERFORM P3200-GENERATE-X217-REC    THRU P3200-EXIT.          DTSBD180
00346                                                                   DTSBD180
00347  P1000-EXIT.                                                      DTSBD180
00348      EXIT.                                                        DTSBD180
00349      EJECT                                                        DTSBD180
00350  P2000-ATC-DETAIL.                                                DTSBD180
00351      PERFORM S923-READ-NEXT          THRU S923-EXIT.              DTSBD180
00352                                                                   DTSBD180
00353      IF (L923-NO-REC-88)                                          DTSBD180
00354              OR                                                   DTSBD180
00355         (ASKL-BATCH-NO NOT = AHDR-BATCH-NO)                       DTSBD180
00356          MOVE 'Y' TO ATC-BATCH-BREAK-IND                          DTSBD180
00357      ELSE                                                         DTSBD180
00358          PERFORM P2100-ACCUM-ACTUALS THRU P2100-EXIT.             DTSBD180
00359  P2000-EXIT.                                                      DTSBD180
00360      EXIT.                                                        DTSBD180
00361      EJECT                                                        DTSBD180
00362  P2100-ACCUM-ACTUALS.                                             DTSBD180
00363      IF ASKL-HDR-88                                               DTSBD180
00364          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBD180
00365                                                                   DTSBD180
00366      IF ASKL-RPT-88                                               DTSBD180
00367          MOVE ASKL-REC TO ARPT-REC                                DTSBD180
00368          IF ARPT-NOT-PROCESSED-88                                 DTSBD180
00369              ADD +1 TO WRK-NOT-PROCESSED-TRAN-CNT                 DTSBD180
00370              ADD ARPT-REMIT-AMT TO WRK-NOT-PROCESSED-REMIT-AMT    DTSBD180
00371          ELSE                                                     DTSBD180
00372              ADD +1 TO WRK-PROCESSED-TRAN-CNT                     DTSBD180
00373              ADD ARPT-REMIT-AMT TO WRK-PROCESSED-REMIT-AMT        DTSBD180
00374      ELSE                                                         DTSBD180
00375      IF ASKL-ATX-88                                               DTSBD180
00376          MOVE ASKL-REC TO AATX-REC                                DTSBD180
00377          IF AATX-NOT-PROCESSED-88                                 DTSBD180
00378              ADD +1 TO WRK-NOT-PROCESSED-TRAN-CNT                 DTSBD180
00379              ADD AATX-REMIT-AMT TO WRK-NOT-PROCESSED-REMIT-AMT    DTSBD180
00380          ELSE                                                     DTSBD180
00381              ADD +1 TO WRK-PROCESSED-TRAN-CNT                     DTSBD180
00382              ADD AATX-REMIT-AMT TO WRK-PROCESSED-REMIT-AMT        DTSBD180
00383      ELSE                                                         DTSBD180
00384      IF ASKL-PAY-88                                               DTSBD180
00385          MOVE ASKL-REC TO APAY-REC                                DTSBD180
00386          IF APAY-NOT-PROCESSED-88                                 DTSBD180
00387              ADD +1 TO WRK-NOT-PROCESSED-TRAN-CNT                 DTSBD180
00388              ADD APAY-REMIT-AMT TO WRK-NOT-PROCESSED-REMIT-AMT    DTSBD180
00389          ELSE                                                     DTSBD180
00390              ADD +1 TO WRK-PROCESSED-TRAN-CNT                     DTSBD180
00391              ADD APAY-REMIT-AMT TO WRK-PROCESSED-REMIT-AMT        DTSBD180
00392      ELSE                                                         DTSBD180
00393      IF ASKL-ADJ-88                                               DTSBD180
00394          MOVE ASKL-REC TO AADJ-REC                                DTSBD180
00395          IF AADJ-NOT-PROCESSED-88                                 DTSBD180
00396              ADD +1 TO WRK-NOT-PROCESSED-TRAN-CNT                 DTSBD180
00397          ELSE                                                     DTSBD180
00398              ADD +1 TO WRK-PROCESSED-TRAN-CNT                     DTSBD180
00399      ELSE                                                         DTSBD180
00400          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBD180
00401  P2100-EXIT.                                                      DTSBD180
00402      EXIT.                                                        DTSBD180
00403      EJECT                                                        DTSBD180
00404  P3000-GENERATE-R301-REC.                                         DTSBD180
00405      MOVE AHDR-DEPOSIT-DATE TO R301-DEPOSIT-DATE.                 DTSBD180
00406                                                                   DTSBD180
00407      MOVE AHDR-BATCH-NO TO R301-BATCH-NO.                         DTSBD180
00408                                                                   DTSBD180
00409      MOVE WRK-R301-RUN-DATE TO R301-CURR-RUN-DATE.                DTSBD180
00410                                                                   DTSBD180
00411      MOVE AHDR-BATCH-BALANCED-IND TO R301-BATCH-BALANCED-IND.     DTSBD180
00412                                                                   DTSBD180
00413      MOVE AHDR-BATCH-HELD-IND TO R301-BATCH-HELD-IND.             DTSBD180
00414                                                                   DTSBD180
00415      MOVE AHDR-ESTB-OP-ID TO R301-ESTB-OP-ID.                     DTSBD180
00416                                                                   DTSBD180
00417      MOVE AHDR-ESTB-DATE TO R301-ESTB-DATE.                       DTSBD180
00418                                                                   DTSBD180
00419      MOVE AHDR-CHNG-OP-ID TO R301-CHNG-OP-ID.                     DTSBD180
00420                                                                   DTSBD180
00421      MOVE AHDR-CHNG-DATE TO R301-CHNG-DATE.                       DTSBD180
00422                                                                   DTSBD180
00423      MOVE AHDR-PROC-TRAN-CNT TO R301-SUCCEEDED-PREV-TRAN-CNT.     DTSBD180
00424                                                                   DTSBD180
00425      MOVE AHDR-PROC-REMIT-AMT TO R301-SUCCEEDED-PREV-REMIT-AMT.   DTSBD180
00426                                                                   DTSBD180
00427      IF AHDR-BATCH-BALANCED-YES-88 AND AHDR-BATCH-HELD-NO-88      DTSBD180
00428         COMPUTE R301-SUCCEEDED-TODAY-TRAN-CNT                     DTSBD180
00429                   = WRK-PROCESSED-TRAN-CNT                        DTSBD180
00430                      - R301-SUCCEEDED-PREV-TRAN-CNT               DTSBD180
00431         COMPUTE R301-SUCCEEDED-TODAY-REMIT-AMT                    DTSBD180
00432                   = WRK-PROCESSED-REMIT-AMT                       DTSBD180
00433                      - R301-SUCCEEDED-PREV-REMIT-AMT              DTSBD180
00434         MOVE WRK-NOT-PROCESSED-TRAN-CNT                           DTSBD180
00435           TO R301-FAILED-TODAY-TRAN-CNT                           DTSBD180
00436         MOVE WRK-NOT-PROCESSED-REMIT-AMT                          DTSBD180
00437           TO R301-FAILED-TODAY-REMIT-AMT                          DTSBD180
00438         MOVE +0 TO R301-BYPASSED-TODAY-TRAN-CNT                   DTSBD180
00439                    R301-BYPASSED-TODAY-REMIT-AMT                  DTSBD180
00440      ELSE                                                         DTSBD180
00441         MOVE +0 TO R301-SUCCEEDED-TODAY-TRAN-CNT                  DTSBD180
00442                    R301-SUCCEEDED-TODAY-REMIT-AMT                 DTSBD180
00443                    R301-FAILED-TODAY-TRAN-CNT                     DTSBD180
00444                    R301-FAILED-TODAY-REMIT-AMT                    DTSBD180
00445         MOVE WRK-NOT-PROCESSED-TRAN-CNT                           DTSBD180
00446           TO R301-BYPASSED-TODAY-TRAN-CNT                         DTSBD180
00447         MOVE WRK-NOT-PROCESSED-REMIT-AMT                          DTSBD180
00448           TO R301-BYPASSED-TODAY-REMIT-AMT.                       DTSBD180
00449                                                                   DTSBD180
00450      MOVE AHDR-ATC-FILE-TRAN-CNT TO R301-ATC-FILE-TRAN-CNT.       DTSBD180
00451                                                                   DTSBD180
00452      MOVE AHDR-ATC-FILE-REMIT-AMT TO R301-ATC-FILE-REMIT-AMT.     DTSBD180
00453                                                                   DTSBD180
00454      MOVE AHDR-CONTROL-TRAN-CNT TO R301-CONTROL-TRAN-CNT.         DTSBD180
00455                                                                   DTSBD180
00456      MOVE AHDR-CONTROL-REMIT-AMT TO R301-CONTROL-REMIT-AMT.       DTSBD180
00457                                                                   DTSBD180
00458      MOVE AHDR-BANK-BATCH-NO     TO R301-BANK-BATCH-NO.           DTSBD180
00459                                                                   DTSBD180
00460      PERFORM S946-WRITE-R301 THRU S946-EXIT.                      DTSBD180
00461                                                                   DTSBD180
00462      ADD +1 TO WRK-R301-REC-CNT.                                  DTSBD180
00463  P3000-EXIT.                                                      DTSBD180
00464      EXIT.                                                        DTSBD180
00465                                                                   DTSBD180
00466  P3200-GENERATE-X217-REC.                                         DTSBD180
00467      MOVE WRK-R301-RUN-DATE         TO L001-FED-8-DATE-9.         DTSBD180
00468      PERFORM S001-FROM-FED-8        THRU S001-EXIT.               DTSBD180
00469      MOVE L001-SLASH-8-DATE         TO X217-PROCESS-DT.           DTSBD180
00470                                                                   DTSBD180
00471      MOVE AHDR-BATCH-NO             TO X217-BATCH.                DTSBD180
00472                                                                   DTSBD180
00473      MOVE AHDR-BATCH-BALANCED-IND   TO X217-BALANCED-IND.         DTSBD180
00474                                                                   DTSBD180
00475      MOVE AHDR-BATCH-HELD-IND       TO X217-HELD-IND.             DTSBD180
00476                                                                   DTSBD180
00477      MOVE AHDR-CONTROL-TRAN-CNT     TO X217-CONTROL-TRAN-CNT.     DTSBD180
00478                                                                   DTSBD180
00479      MOVE AHDR-CONTROL-REMIT-AMT    TO X217-CONTROL-REMIT-AMT.    DTSBD180
00480                                                                   DTSBD180
00481      MOVE AHDR-ATC-FILE-TRAN-CNT    TO X217-ATC-FILE-TRAN-CNT.    DTSBD180
00482                                                                   DTSBD180
00483      MOVE AHDR-ATC-FILE-REMIT-AMT   TO X217-ATC-FILE-REMIT-AMT.   DTSBD180
00484                                                                   DTSBD180
00485      MOVE WRK-PROCESSED-TRAN-CNT    TO X217-PROCESSED-CNT.        DTSBD180
00486                                                                   DTSBD180
00487      MOVE WRK-PROCESSED-REMIT-AMT   TO X217-PROCESSED-REMIT.      DTSBD180
00488                                                                   DTSBD180
00489      MOVE AHDR-DEPOSIT-DATE         TO L001-FED-8-DATE-9.         DTSBD180
00490      PERFORM S001-FROM-FED-8        THRU S001-EXIT.               DTSBD180
00491      MOVE L001-SLASH-8-DATE         TO X217-DEPOSIT-DATE.         DTSBD180
00492                                                                   DTSBD180
00493      MOVE AHDR-CHNG-OP-ID           TO X217-CHNG-OP-ID.           DTSBD180
00494                                                                   DTSBD180
00495      MOVE AHDR-BANK-BATCH-NO        TO X217-BANK-BATCH.           DTSBD180
00496                                                                   DTSBD180
00497      MOVE AHDR-ESTB-OP-ID           TO X217-ESTB-OP-ID.           DTSBD180
00498                                                                   DTSBD180
00499      MOVE AHDR-ESTB-DATE            TO L001-FED-8-DATE-9.         DTSBD180
00500      PERFORM S001-FROM-FED-8        THRU S001-EXIT.               DTSBD180
00501      MOVE L001-SLASH-8-DATE         TO X217-ESTB-DATE.            DTSBD180
00502                                                                   DTSBD180
00503      MOVE AHDR-DEPOSIT-ID           TO X217-DEPOSIT-ID.           DTSBD180
00504                                                                   DTSBD180
00505      MOVE AHDR-ANNUAL-BATCH-IND     TO X217-ANN-BATCH.            DTSBD180
00506                                                                   DTSBD180
00507      MOVE AHDR-RECEIVED-DATE        TO L001-FED-8-DATE-9.         DTSBD180
00508      PERFORM S001-FROM-FED-8        THRU S001-EXIT.               DTSBD180
00509      MOVE L001-SLASH-8-DATE         TO X217-RCVD-DATE.            DTSBD180
00510                                                                   DTSBD180
00511      WRITE BX217-REC                FROM WRK-X217-REC.            DTSBD180
00512      ADD +1                         TO WRK-X217-REC-CNT.          DTSBD180
00513                                                                   DTSBD180
00514  P3200-EXIT.                                                      DTSBD180
00515      EXIT.                                                        DTSBD180
00516                                                                   DTSBD180
00517  P4000-PROCESSED-BATCH.                                           DTSBD180
00518      MOVE AHDR-DOC-NO TO ASKL-DOC-NO.                             DTSBD180
00519                                                                   DTSBD180
00520      PERFORM S923-READ THRU S923-EXIT.                            DTSBD180
00521                                                                   DTSBD180
00522      IF L923-NO-REC-88                                            DTSBD180
00523         PERFORM S999-ABEND THRU S999-EXIT.                        DTSBD180
00524                                                                   DTSBD180
00525                                                                   DTSBD180
00526      IF WRK-NOT-PROCESSED-TRAN-CNT = +0                           DTSBD180
00527         PERFORM P4100-DELETE-BATCH THRU P4100-EXIT                DTSBD180
00528      ELSE                                                         DTSBD180
00529         PERFORM P4200-UPDATE-BATCH-HDR THRU P4200-EXIT.           DTSBD180
00530  P4000-EXIT.                                                      DTSBD180
00531      EXIT.                                                        DTSBD180
00532      EJECT                                                        DTSBD180
00533  P4100-DELETE-BATCH.                                              DTSBD180
00534      PERFORM S923-DELETE THRU S923-EXIT.                          DTSBD180
00535                                                                   DTSBD180
00536      ADD +1 TO WRK-AHDR-DELETED-CNT.                              DTSBD180
00537                                                                   DTSBD180
00538                                                                   DTSBD180
00539      PERFORM P4110-DELETE-TRANSACTIONS THRU P4110-EXIT            DTSBD180
00540          UNTIL (L923-NO-REC-88)                                   DTSBD180
00541                     OR                                            DTSBD180
00542                (ASKL-BATCH-NO NOT = AHDR-BATCH-NO).               DTSBD180
00543  P4100-EXIT.                                                      DTSBD180
00544      EXIT.                                                        DTSBD180
00545      SKIP3                                                        DTSBD180
00546  P4110-DELETE-TRANSACTIONS.                                       DTSBD180
00547      PERFORM S923-START-BROWSE THRU S923-EXIT.                    DTSBD180
00548                                                                   DTSBD180
00549      IF (L923-NO-REC-88)                                          DTSBD180
00550            OR                                                     DTSBD180
00551         (ASKL-BATCH-NO NOT = AHDR-BATCH-NO)                       DTSBD180
00552          GO TO P4110-EXIT.                                        DTSBD180
00553                                                                   DTSBD180
00554      PERFORM S923-DELETE THRU S923-EXIT.                          DTSBD180
00555  P4110-EXIT.                                                      DTSBD180
00556      EXIT.                                                        DTSBD180
00557      EJECT                                                        DTSBD180
00558  P4200-UPDATE-BATCH-HDR.                                          DTSBD180
00559      MOVE WRK-PROCESSED-TRAN-CNT TO AHDR-PROC-TRAN-CNT.           DTSBD180
00560                                                                   DTSBD180
00561      MOVE WRK-PROCESSED-REMIT-AMT TO AHDR-PROC-REMIT-AMT.         DTSBD180
00562                                                                   DTSBD180
00563                                                                   DTSBD180
00564      MOVE AHDR-REC TO ASKL-REC.                                   DTSBD180
00565                                                                   DTSBD180
00566      PERFORM S923-REWRITE THRU S923-EXIT.                         DTSBD180
00567                                                                   DTSBD180
00568      ADD +1 TO WRK-AHDR-RETAINED-CNT.                             DTSBD180
00569  P4200-EXIT.                                                      DTSBD180
00570      EXIT.                                                        DTSBD180
00571      EJECT                                                        DTSBD180
00572  T0000-TERMINATE.                                                 DTSBD180
00573      DISPLAY ' '.                                                 DTSBD180
00574                                                                   DTSBD180
00575      DISPLAY '*** DTSBD180 TERMINATION STATISTICS ***'.           DTSBD180
00576                                                                   DTSBD180
00577      DISPLAY '    NUMBER OF BALANCED HEADER RECORDS ENCOUNTERED: 'DTSBD180
00578              WRK-AHDR-BALANCED-CNT.                               DTSBD180
00579                                                                   DTSBD180
00580      DISPLAY 'NUMBER OF NOT BALANCED HEADER RECORDS ENCOUNTERED: 'DTSBD180
00581              WRK-AHDR-NOT-BALANCED-CNT.                           DTSBD180
00582                                                                   DTSBD180
00583      DISPLAY '        NUMBER OF HELD HEADER RECORDS ENCOUNTERED: 'DTSBD180
00584              WRK-AHDR-HELD-CNT.                                   DTSBD180
00585                                                                   DTSBD180
00586      DISPLAY '    NUMBER OF NOT HELD HEADER RECORDS ENCOUNTERED: 'DTSBD180
00587              WRK-AHDR-NOT-HELD-CNT.                               DTSBD180
00588                                                                   DTSBD180
00589      DISPLAY '   NUMBER OF PROCESSED HEADER RECORDS ENCOUNTERED: 'DTSBD180
00590              WRK-AHDR-PROCESSED-CNT                               DTSBD180
00591                                                                   DTSBD180
00592      DISPLAY '    NUMBER OF BYPASSED HEADER RECORDS ENCOUNTERED: 'DTSBD180
00593              WRK-AHDR-BYPASSED-CNT.                               DTSBD180
00594                                                                   DTSBD180
00595      DISPLAY '                 NUMBER OF HEADER RECORDS DELETED: 'DTSBD180
00596              WRK-AHDR-DELETED-CNT.                                DTSBD180
00597                                                                   DTSBD180
00598      DISPLAY '                NUMBER OF HEADER RECORDS RETAINED: 'DTSBD180
00599              WRK-AHDR-RETAINED-CNT.                               DTSBD180
00600                                                                   DTSBD180
00601      DISPLAY ' '.                                                 DTSBD180
00602                                                                   DTSBD180
00603      DISPLAY '                   NUMBER OF R301 RECORDS CREATED: 'DTSBD180
00604              WRK-R301-REC-CNT.                                    DTSBD180
00605      DISPLAY ' '.                                                 DTSBD180
00606                                                                   DTSBD180
00607      DISPLAY '                   NUMBER OF X217 RECORDS CREATED: 'DTSBD180
00608              WRK-X217-REC-CNT.                                    DTSBD180
00609                                                                   DTSBD180
00610      DISPLAY ' '.                                                 DTSBD180
00611                                                                   DTSBD180
00612                                                                   DTSBD180
00613      PERFORM S910-CLOSE THRU S910-EXIT.                           DTSBD180
00614                                                                   DTSBD180
00615      PERFORM S923-CLOSE THRU S923-EXIT.                           DTSBD180
00616                                                                   DTSBD180
00617      MOVE -1 TO R301-LENGTH.                                      DTSBD180
00618                                                                   DTSBD180
00619      PERFORM S946-WRITE-R301 THRU S946-EXIT.                      DTSBD180
00620                                                                   DTSBD180
00621      CLOSE BX217-BATCH-FILE.                                      DTSBD180
00622  T0000-EXIT.                                                      DTSBD180
00623      EXIT.                                                        DTSBD180
00624      EJECT                                                        DTSBD180
00625  S001-FROM-FED-8.                                                 DTSBD180
00626      SET L001-FROM-FED-8 TO TRUE.                                 DTSBD180
00627      GO TO S001-DATE.                                             DTSBD180
00628                                                                   DTSBD180
00629  S001-FROM-ABS-DAY.                                               DTSBD180
00630      SET L001-FROM-ABS-DAY TO TRUE.                               DTSBD180
00631      GO TO S001-DATE.                                             DTSBD180
00632                                                                   DTSBD180
00633  S001-DATE.                                                       DTSBD180
00634      CALL 'DTSBU001' USING L001-LINK-AREA.                        DTSBD180
00635  S001-EXIT.                                                       DTSBD180
00636      EXIT.                                                        DTSBD180
00637                                                                   DTSBD180
00638  S910-OPEN-READ.                                                  DTSBD180
00639      SET L910-OPEN-READ-88 TO TRUE.                               DTSBD180
00640      GO TO S910-MSTR-IO.                                          DTSBD180
00641                                                                   DTSBD180
00642  S910-READ.                                                       DTSBD180
00643      SET L910-READ-88 TO TRUE.                                    DTSBD180
00644      GO TO S910-MSTR-IO.                                          DTSBD180
00645                                                                   DTSBD180
00646 *S910-START-BROWSE.                                               DTSBD180
00647 *****SET L910-START-BROWSE-88 TO TRUE.                            DTSBD180
00648 *****GO TO S910-MSTR-IO.                                          DTSBD180
00649                                                                   DTSBD180
00650 *S910-READ-NEXT.                                                  DTSBD180
00651 *****SET L910-READ-NEXT-88 TO TRUE.                               DTSBD180
00652 *****GO TO S910-MSTR-IO.                                          DTSBD180
00653                                                                   DTSBD180
00654 *S910-COUNT.                                                      DTSBD180
00655 *****SET L910-COUNT-88 TO TRUE.                                   DTSBD180
00656 *****GO TO S910-MSTR-IO.                                          DTSBD180
00657                                                                   DTSBD180
00658  S910-CLOSE.                                                      DTSBD180
00659      SET L910-CLOSE-88 TO TRUE.                                   DTSBD180
00660      GO TO S910-MSTR-IO.                                          DTSBD180
00661                                                                   DTSBD180
00662  S910-MSTR-IO.                                                    DTSBD180
00663      CALL 'DTSBU910' USING L910-LINK-AREA                         DTSBD180
00664                            MSKL-REC.                              DTSBD180
00665  S910-EXIT.                                                       DTSBD180
00666      EXIT.                                                        DTSBD180
00667      SKIP3                                                        DTSBD180
00668  S923-OPEN-UPDATE.                                                DTSBD180
00669      SET L923-OPEN-UPDATE-88 TO TRUE.                             DTSBD180
00670      GO TO S923-ATC-IO.                                           DTSBD180
00671                                                                   DTSBD180
00672  S923-READ.                                                       DTSBD180
00673      SET L923-READ-88 TO TRUE.                                    DTSBD180
00674      GO TO S923-ATC-IO.                                           DTSBD180
00675                                                                   DTSBD180
00676  S923-START-BROWSE.                                               DTSBD180
00677      SET L923-START-BROWSE-88 TO TRUE.                            DTSBD180
00678      GO TO S923-ATC-IO.                                           DTSBD180
00679                                                                   DTSBD180
00680  S923-READ-NEXT.                                                  DTSBD180
00681      SET L923-READ-NEXT-88 TO TRUE.                               DTSBD180
00682      GO TO S923-ATC-IO.                                           DTSBD180
00683                                                                   DTSBD180
00684 *S923-WRITE.                                                      DTSBD180
00685 *****SET L923-WRITE-88 TO TRUE.                                   DTSBD180
00686 *****GO TO S923-ATC-IO.                                           DTSBD180
00687                                                                   DTSBD180
00688  S923-REWRITE.                                                    DTSBD180
00689      SET L923-REWRITE-88 TO TRUE.                                 DTSBD180
00690      GO TO S923-ATC-IO.                                           DTSBD180
00691                                                                   DTSBD180
00692  S923-DELETE.                                                     DTSBD180
00693      SET L923-DELETE-88 TO TRUE.                                  DTSBD180
00694      GO TO S923-ATC-IO.                                           DTSBD180
00695                                                                   DTSBD180
00696  S923-CLOSE.                                                      DTSBD180
00697      SET L923-CLOSE-88 TO TRUE.                                   DTSBD180
00698      GO TO S923-ATC-IO.                                           DTSBD180
00699                                                                   DTSBD180
00700  S923-ATC-IO.                                                     DTSBD180
00701      CALL 'DTSBU923' USING L923-LINK-AREA                         DTSBD180
00702                            ASKL-REC.                              DTSBD180
00703  S923-EXIT.                                                       DTSBD180
00704      EXIT.                                                        DTSBD180
00705      SKIP3                                                        DTSBD180
00706  S946-WRITE-R301.                                                 DTSBD180
00707      CALL 'DTSBU946' USING R301-REC.                              DTSBD180
00708      GO TO S946-EXIT.                                             DTSBD180
00709                                                                   DTSBD180
00710  S946-EXIT.                                                       DTSBD180
00711      EXIT.                                                        DTSBD180
00712      SKIP3                                                        DTSBD180
00713  S999-ABEND.                                                      DTSBD180
00714      CALL 'DTSBU999' USING WRK-ABEND-CD.                          DTSBD180
00715  S999-EXIT.                                                       DTSBD180
00716      EXIT.                                                        DTSBD180
