00001  IDENTIFICATION DIVISION.                                         08/28/02
00002  PROGRAM-ID.             DESBD112.                                DESBD112
00003  AUTHOR.                 TRW.                                        LV003
00004  DATE-WRITTEN.           APRIL 2001.                              DESBD112
00005  DATE-COMPILED.                                                   DESBD112
00006      SKIP3                                                        DESBD112
00007 *****                                                             DESBD112
00008 *                                                                 DESBD112
00009 *    FUNCTION:  MERGE W4 TRANSACTIONS FROM DAILY                  DESBD112
00010 *               FLAT FILE TO PRODUCTION FILE THAT IS INPUT TO     DESBD112
00011 *               THE WAGE UPDATE PROCESS.                          DESBD112
00012 *               ELECTRONIC MEDIA TRACKING SYSTEM                  DESBD112
00013 *                                                                 DESBD112
00014 *                                                                 DESBD112
00015 *****                                                             DESBD112
00016      SKIP3                                                        DESBD112
00017  ENVIRONMENT DIVISION.                                            DESBD112
00018  INPUT-OUTPUT SECTION.                                            DESBD112
00019  FILE-CONTROL.                                                    DESBD112
00020      SELECT BD110-W4-IN-FILE ASSIGN TO BD110W4                    DESBD112
00021             FILE STATUS IS BD110-W4-IN-STATUS.                    DESBD112
00022                                                                   DESBD112
00023      SELECT BD110-W4-OUT-FILE ASSIGN TO BD110W4O                  DESBD112
00024             FILE STATUS IS BD110-W4-OUT-STATUS.                   DESBD112
00025                                                                   DESBD112
00026      SKIP2                                                        DESBD112
00027  DATA DIVISION.                                                   DESBD112
00028  FILE SECTION.                                                    DESBD112
00029  FD  BD110-W4-IN-FILE                                             DESBD112
00030      RECORDING MODE IS F                                          DESBD112
00031      BLOCK CONTAINS 0 RECORDS.                                    DESBD112
00032                                                                   DESBD112
00033  01  BD110-W4-IN-REC.                                             DESBD112
00034      05  BD110-W4-IN-LOG-NO              PIC  9(10).              DESBD112
00035      05  BD110-W4-IN-DATA                PIC  X(80).              DESBD112
00036                                                                   DESBD112
00037  FD  BD110-W4-OUT-FILE                                            DESBD112
00038      RECORDING MODE IS F                                          DESBD112
00039      BLOCK CONTAINS 0 RECORDS.                                    DESBD112
00040                                                                   DESBD112
00041  01  BD110-W4-OUT-REC                    PIC  X(80).              DESBD112
00042                                                                   DESBD112
00043  WORKING-STORAGE SECTION.                                         DESBD112
000435 77  PAN-VALET PICTURE X(24) VALUE '003DESBD112  08/28/02'.       DESBD112
00044      SKIP3                                                        DESBD112
00045  01  WRK-AREA.                                                    DESBD112
00046      05  WRK-ABEND-CD            PIC S9(04)  COMP  VALUE +112.    DESBD112
00047                                                                   DESBD112
00048      05  WRK-INPUT-CNT           PIC  9(07)  COMP-3 VALUE 0.      DESBD112
00049      05  WRK-OUTPUT-CNT          PIC  9(07)  COMP-3 VALUE 0.      DESBD112
00050      05  WRK-CNT-DISP            PIC  Z(06)9.                     DESBD112
00051                                                                   DESBD112
00052      05  BD110-W4-IN-STATUS          PIC  X(02).                  DESBD112
00053          88 BD110-W4-IN-OK-88     VALUE '00'.                     DESBD112
00054          88 BD110-W4-IN-EOF-88    VALUE '10'.                     DESBD112
00055                                                                   DESBD112
00056      05  BD110-W4-OUT-STATUS         PIC  X(02).                  DESBD112
00057          88 BD110-W4-OUT-OK-88    VALUE '00'.                     DESBD112
00058                                                                   DESBD112
00059      05  WRK-ERROR-IND               PIC  X(01).                  DESBD112
00060          88 WRK-ERROR-YES-88      VALUE 'Y'.                      DESBD112
00061          88 WRK-ERROR-NO-88       VALUE 'N'.                      DESBD112
00062                                                                   DESBD112
00063      05  WRK-SELECT-IND              PIC  X(01).                  DESBD112
00064          88 WRK-SELECT-YES-88     VALUE 'Y'.                      DESBD112
00065          88 WRK-SELECT-NO-88      VALUE 'N'.                      DESBD112
00066                                                                   DESBD112
00067      05  WRK-DUMMY-REC               PIC  X(80)                   DESBD112
00068                                   VALUE ZEROS.                    DESBD112
00069                                                                   DESBD112
00070  LINKAGE SECTION.                                                 DESBD112
00071  01  BD110-LINK-AREA.                                             DESBD112
00072  ++INCLUDE DESIL110                                               DESBD112
00073                                                                   DESBD112
00074  PROCEDURE DIVISION USING BD110-LINK-AREA.                        DESBD112
00075                                                                   DESBD112
00076  DESBD112-MAIN.                                                   DESBD112
00077      PERFORM I0000-INITIATE THRU I0000-EXIT.                      DESBD112
00078      IF WRK-ERROR-YES-88                                          DESBD112
00079         GO TO DESBD112-MAIN-EXIT.                                 DESBD112
00080                                                                   DESBD112
00081      PERFORM P0000-PROCESS THRU P0000-EXIT.                       DESBD112
00082                                                                   DESBD112
00083      PERFORM T0000-TERMINATE THRU T0000-EXIT.                     DESBD112
00084                                                                   DESBD112
00085  DESBD112-MAIN-EXIT.                                              DESBD112
00086      GOBACK.                                                      DESBD112
00087      EJECT                                                        DESBD112
00088  I0000-INITIATE.                                                  DESBD112
00089      SET WRK-ERROR-NO-88 TO TRUE.                                 DESBD112
00090                                                                   DESBD112
00091      PERFORM I1000-OPEN-FILES           THRU I1000-EXIT.          DESBD112
00092                                                                   DESBD112
00093  I0000-EXIT.                                                      DESBD112
00094      EXIT.                                                        DESBD112
00095                                                                   DESBD112
00096  I1000-OPEN-FILES.                                                DESBD112
00097      OPEN INPUT BD110-W4-IN-FILE.                                 DESBD112
00098      IF NOT BD110-W4-IN-OK-88                                     DESBD112
00099         DISPLAY 'CANNOT OPEN INPUT FILE '                         DESBD112
00100            BD110-W4-IN-STATUS                                     DESBD112
00101         SET WRK-ERROR-YES-88 TO TRUE                              DESBD112
00102         GO TO I1000-EXIT.                                         DESBD112
00103                                                                   DESBD112
00104      OPEN OUTPUT BD110-W4-OUT-FILE.                               DESBD112
00105      IF NOT BD110-W4-OUT-OK-88                                    DESBD112
00106         DISPLAY 'CANNOT OPEN OUTPUT FILE '                        DESBD112
00107            BD110-W4-OUT-STATUS                                    DESBD112
00108         SET WRK-ERROR-YES-88 TO TRUE                              DESBD112
00109         GO TO I1000-EXIT.                                         DESBD112
00110                                                                   DESBD112
00111  I1000-EXIT.                                                      DESBD112
00112      EXIT.                                                        DESBD112
00113                                                                   DESBD112
00114      EJECT                                                        DESBD112
00115  P0000-PROCESS.                                                   DESBD112
00116      IF L110-LOG-CNT = ZERO                                       DESBD112
00117         PERFORM P1300-WRITE-DUMMY-REC  THRU P1300-EXIT            DESBD112
00118         GO TO P0000-EXIT.                                         DESBD112
00119                                                                   DESBD112
00120      READ BD110-W4-IN-FILE.                                       DESBD112
00121      IF NOT BD110-W4-IN-OK-88                                     DESBD112
00122         DISPLAY 'INPUT FILE EMPTY '                               DESBD112
00123            BD110-W4-IN-STATUS                                     DESBD112
00124         GO TO P0000-EXIT.                                         DESBD112
00125                                                                   DESBD112
00126      PERFORM P1000-INPUT-LOOP      THRU P1000-EXIT                DESBD112
00127         UNTIL WRK-ERROR-YES-88                                    DESBD112
00128         OR    BD110-W4-IN-EOF-88.                                 DESBD112
00129                                                                   DESBD112
00130  P0000-EXIT.                                                      DESBD112
00131      EXIT.                                                        DESBD112
00132      EJECT                                                        DESBD112
00133                                                                   DESBD112
00134  P1000-INPUT-LOOP.                                                DESBD112
00135      ADD +1 TO WRK-INPUT-CNT.                                     DESBD112
00136                                                                   DESBD112
00137      SET WRK-SELECT-NO-88  TO TRUE.                               DESBD112
00138      PERFORM P1100-SCAN-LOG-TABLE   THRU P1100-EXIT.              DESBD112
00139      IF WRK-SELECT-YES-88                                         DESBD112
00140         PERFORM P1200-WRITE-OUTPUT  THRU P1200-EXIT.              DESBD112
00141                                                                   DESBD112
00142      READ BD110-W4-IN-FILE.                                       DESBD112
00143                                                                   DESBD112
00144  P1000-EXIT.                                                      DESBD112
00145      EXIT.                                                        DESBD112
00146                                                                   DESBD112
00147  P1100-SCAN-LOG-TABLE.                                            DESBD112
00148      SET LOG-IDX TO +1.                                           DESBD112
00149      SEARCH L110-LOG-NO-TABLE VARYING LOG-IDX                     DESBD112
00150         WHEN BD110-W4-IN-LOG-NO = L110-LOG-NO (LOG-IDX)           DESBD112
00151            SET WRK-SELECT-YES-88 TO TRUE                          DESBD112
00152      END-SEARCH.                                                  DESBD112
00153                                                                   DESBD112
00154  P1100-EXIT.                                                      DESBD112
00155      EXIT.                                                        DESBD112
00156                                                                   DESBD112
00157  P1200-WRITE-OUTPUT.                                              DESBD112
00158      ADD +1 TO WRK-OUTPUT-CNT.                                    DESBD112
00159                                                                   DESBD112
00160      MOVE BD110-W4-IN-DATA   TO BD110-W4-OUT-REC.                 DESBD112
00161      WRITE BD110-W4-OUT-REC.                                      DESBD112
00162      IF NOT BD110-W4-OUT-OK-88                                    DESBD112
00163         DISPLAY 'CANNOT WRITE OUTPUT '                            DESBD112
00164            BD110-W4-OUT-STATUS                                    DESBD112
00165         SET WRK-ERROR-YES-88 TO TRUE                              DESBD112
00166         GO TO P1200-EXIT.                                         DESBD112
00167                                                                   DESBD112
00168  P1200-EXIT.                                                      DESBD112
00169      EXIT.                                                        DESBD112
00170                                                                   DESBD112
00171  P1300-WRITE-DUMMY-REC.                                           DESBD112
00172      MOVE WRK-DUMMY-REC      TO BD110-W4-OUT-REC.                 DESBD112
00173      WRITE BD110-W4-OUT-REC.                                      DESBD112
00174      IF NOT BD110-W4-OUT-OK-88                                    DESBD112
00175         DISPLAY 'CANNOT WRITE OUTPUT '                            DESBD112
00176            BD110-W4-OUT-STATUS.                                   DESBD112
00177                                                                   DESBD112
00178  P1300-EXIT.                                                      DESBD112
00179      EXIT.                                                        DESBD112
00180                                                                   DESBD112
00181                                                                   DESBD112
00182  T0000-TERMINATE.                                                 DESBD112
00183                                                                   DESBD112
00184      DISPLAY ' '.                                                 DESBD112
00185                                                                   DESBD112
00186      DISPLAY '*** DESBD112 TERMINATION STATISTICS ***'.           DESBD112
00187                                                                   DESBD112
00188      DISPLAY ' '.                                                 DESBD112
00189                                                                   DESBD112
00190      MOVE WRK-INPUT-CNT  TO WRK-CNT-DISP.                         DESBD112
00191      DISPLAY '    INPUT RECORDS READ:     '                       DESBD112
00192         WRK-CNT-DISP.                                             DESBD112
00193                                                                   DESBD112
00194      MOVE WRK-OUTPUT-CNT TO WRK-CNT-DISP.                         DESBD112
00195      DISPLAY '    OUTPUT RECORDS WRITTEN: '                       DESBD112
00196         WRK-CNT-DISP.                                             DESBD112
00197                                                                   DESBD112
00198      DISPLAY SPACE.                                               DESBD112
00199                                                                   DESBD112
00200      CLOSE BD110-W4-IN-FILE                                       DESBD112
00201            BD110-W4-OUT-FILE.                                     DESBD112
00202                                                                   DESBD112
00203  T0000-EXIT.                                                      DESBD112
00204      EXIT.                                                        DESBD112
