00001  IDENTIFICATION DIVISION.                                         06/08/04
00002  PROGRAM-ID.             DESBD315.                                DESBD315
00003  AUTHOR.                 NGC.                                        LV001
00004  DATE-WRITTEN.           MAY 2004.                                DESBD315
00005  DATE-COMPILED.                                                   DESBD315
00006                                                                   DESBD315
00007 *****                                                             DESBD315
00008 *                                                                 DESBD315
00009 *    FUNCTION:  MERGE WAGE RECORDS PRODUCED BY DESBD310.          DESBD315
00010 *               FOR EACH WAGE ITEM FOUND, DESBD310 LOOKS FOR A    DESBD315
00011 *               SUCCESSOR ACCOUNT NUMBER, AND MOVES THAT NUMBER   DESBD315
00012 *               TO THE OUPUT RECORD. THIS MAY RESULT IN DUPLICATE DESBD315
00013 *               RECORDS.  DESBD315 FINDS THESE DUPLICATES AND     DESBD315
00014 *               COMBINES THEM INTO A SINGLE OUTPUT RECORD.        DESBD315
00015 *                                                                 DESBD315
00016 *    MODIFICATION HISTORY:                                        DESBD315
00017 *                                                                 DESBD315
00018 *    05/25/2004  INITIAL DEVELOPMENT                              DESBD315
00019 *                REFERANCE:                     PROGRAMMER: GD    DESBD315
00020 *                                                                 DESBD315
00021 *    MM/DD/YYYY  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   DESBD315
00022 *                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   DESBD315
00023 *                REFERENCE: XXXXXXXXXXXXXXX     PROGRAMMER: XXX   DESBD315
00024 *                                                                 DESBD315
00025 *    DESCRIPTION:                                                 DESBD315
00026 *                                                                 DESBD315
00027 *                                                                 DESBD315
00028 *    RECORDS READ:                                                DESBD315
00029 *        WAGE RECORDS OUTPUT FROM DESBD310                        DESBD315
00030 *                                                                 DESBD315
00031 *    PRINTED OUTPUTS:                                             DESBD315
00032 *        NONE                                                     DESBD315
00033 *                                                                 DESBD315
00034 *    RECORDS WRITTEN:                                             DESBD315
00035 *        DTSIWWGH WAGE RECORDS                                    DESBD315
00036 *                                                                 DESBD315
00037 *    MODULES CALLED:                                              DESBD315
00038 *         NONE                                                    DESBD315
00039 *                                                                 DESBD315
00040 *****                                                             DESBD315
00041                                                                   DESBD315
00042  ENVIRONMENT DIVISION.                                            DESBD315
00043      SKIP2                                                        DESBD315
00044  INPUT-OUTPUT SECTION.                                            DESBD315
00045      SKIP3                                                        DESBD315
00046  FILE-CONTROL.                                                    DESBD315
00047      SELECT WAGE-IN-FILE ASSIGN TO DTSFWGHI                       DESBD315
00048             FILE STATUS IS WAGE-IN-STATUS.                        DESBD315
00049                                                                   DESBD315
00050      SELECT WAGE-OUT-FILE ASSIGN TO DTSFWGHO                      DESBD315
00051             FILE STATUS IS WAGE-OUT-STATUS.                       DESBD315
00052      SKIP2                                                        DESBD315
00053                                                                   DESBD315
00054  DATA DIVISION.                                                   DESBD315
00055      SKIP2                                                        DESBD315
00056  FILE SECTION.                                                    DESBD315
00057      SKIP2                                                        DESBD315
00058  FD  WAGE-IN-FILE                                                 DESBD315
00059      RECORDING MODE IS F                                          DESBD315
00060      LABEL RECORDS ARE STANDARD                                   DESBD315
00061      BLOCK CONTAINS 0 CHARACTERS.                                 DESBD315
00062      SKIP1                                                        DESBD315
00063  01  WGH-IN-REC.                                                  DESBD315
00064  ++INCLUDE DTSIWWGH                                               DESBD315
00065                                                                   DESBD315
00066  FD  WAGE-OUT-FILE                                                DESBD315
00067      RECORDING MODE IS F                                          DESBD315
00068      LABEL RECORDS ARE STANDARD                                   DESBD315
00069      BLOCK CONTAINS 0 CHARACTERS.                                 DESBD315
00070      SKIP1                                                        DESBD315
00071  01  WGH-OUT-REC           PIC X(18).                             DESBD315
00072                                                                   DESBD315
00073      EJECT                                                        DESBD315
00074  WORKING-STORAGE SECTION.                                         DESBD315
000745 77  PAN-VALET PICTURE X(24) VALUE '001DESBD315  06/08/04'.       DESBD315
00075      SKIP3                                                        DESBD315
00076  01  WRK-AREA.                                                    DESBD315
00077      05  WRK-ERROR-IND               PIC  X(01) VALUE 'N'.        DESBD315
00078          88 WRK-ERROR-YES-88           VALUE 'Y'.                 DESBD315
00079          88 WRK-ERROR-NO-88            VALUE 'N'.                 DESBD315
00080                                                                   DESBD315
00081      05  WRK-MOD-NAME                PIC  X(08) VALUE 'DESBD315'. DESBD315
00082      05  WRK-TRACE-IND               PIC  X(01) VALUE 'N'.        DESBD315
00083                                                                   DESBD315
00084      05  WAGE-IN-STATUS          PIC  X(02) VALUE SPACES.         DESBD315
00085          88  WAGE-IN-OK-88           VALUE ZERO.                  DESBD315
00086          88  WAGE-IN-EOF-88          VALUE '10'.                  DESBD315
00087                                                                   DESBD315
00088      05  WAGE-OUT-STATUS          PIC  X(02) VALUE SPACES.        DESBD315
00089          88  WAGE-OUT-OK-88            VALUE ZERO.                DESBD315
00090                                                                   DESBD315
00091      05  WRK-EMP-NO                  PIC S9(07)  COMP-3 VALUE +0. DESBD315
00092      05  WRK-SUCCESSOR               PIC S9(07)  COMP-3 VALUE +0. DESBD315
00093                                                                   DESBD315
00094      05  WRK-WWGH-READ-CNT           PIC S9(07)  COMP-3 VALUE +0. DESBD315
00095      05  WRK-WWGH-WRITE-CNT          PIC S9(07)  COMP-3 VALUE +0. DESBD315
00096      05  WRK-DUPLICATE-CNT           PIC S9(07)  COMP-3 VALUE +0. DESBD315
00097                                                                   DESBD315
00098  01  WGH-HOLD-REC.                                                DESBD315
00099  ++INCLUDE DTSIWWGH                                               DESBD315
00100      EJECT                                                        DESBD315
00101  PROCEDURE DIVISION.                                              DESBD315
00102                                                                   DESBD315
00103  DESBD315-MAIN.                                                   DESBD315
00104      PERFORM I0000-INIT         THRU I0000-EXIT.                  DESBD315
00105      IF WRK-ERROR-YES-88                                          DESBD315
00106         GO TO DESBD315-MAIN-EXIT.                                 DESBD315
00107                                                                   DESBD315
00108      PERFORM P0000-PROCESS    THRU P0000-EXIT.                    DESBD315
00109                                                                   DESBD315
00110      PERFORM T0000-TERMINATE THRU T0000-EXIT.                     DESBD315
00111                                                                   DESBD315
00112  DESBD315-MAIN-EXIT.                                              DESBD315
00113      GOBACK.                                                      DESBD315
00114                                                                   DESBD315
00115  I0000-INIT.                                                      DESBD315
00116      OPEN INPUT WAGE-IN-FILE.                                     DESBD315
00117      IF NOT WAGE-IN-OK-88                                         DESBD315
00118         DISPLAY 'CANNOT OPEN INPUT FILE ' WAGE-IN-STATUS          DESBD315
00119         SET WRK-ERROR-YES-88  TO TRUE                             DESBD315
00120         GO TO I0000-EXIT.                                         DESBD315
00121                                                                   DESBD315
00122      OPEN OUTPUT WAGE-OUT-FILE.                                   DESBD315
00123      IF NOT WAGE-OUT-OK-88                                        DESBD315
00124         DISPLAY 'CANNOT OPEN OUTPUT FILE ' WAGE-OUT-STATUS        DESBD315
00125         SET WRK-ERROR-YES-88  TO TRUE                             DESBD315
00126         GO TO I0000-EXIT.                                         DESBD315
00127                                                                   DESBD315
00128      MOVE ZERO             TO WWGH-SSN      OF WGH-HOLD-REC       DESBD315
00129                               WWGH-EMP-NO   OF WGH-HOLD-REC       DESBD315
00130                               WWGH-YRQ      OF WGH-HOLD-REC       DESBD315
00131                               WWGH-EARNINGS OF WGH-HOLD-REC.      DESBD315
00132                                                                   DESBD315
00133  I0000-EXIT.                                                      DESBD315
00134      EXIT.                                                        DESBD315
00135                                                                   DESBD315
00136  P0000-PROCESS.                                                   DESBD315
00137      PERFORM P1200-READ-NEXT-WWGH        THRU P1200-EXIT.         DESBD315
00138      IF WAGE-IN-EOF-88                                            DESBD315
00139         DISPLAY 'INPUT FILE IS EMPTY'                             DESBD315
00140         GO TO P0000-EXIT                                          DESBD315
00141      ELSE                                                         DESBD315
00142         MOVE WGH-IN-REC                  TO WGH-HOLD-REC          DESBD315
00143      END-IF.                                                      DESBD315
00144                                                                   DESBD315
00145      PERFORM P1200-READ-NEXT-WWGH        THRU P1200-EXIT.         DESBD315
00146      PERFORM P1000-PROCESS-FILE          THRU P1000-EXIT          DESBD315
00147         UNTIL WAGE-IN-EOF-88.                                     DESBD315
00148                                                                   DESBD315
00149  P0000-EXIT.                                                      DESBD315
00150      EXIT.                                                        DESBD315
00151                                                                   DESBD315
00152  P1000-PROCESS-FILE.                                              DESBD315
00153      IF (WWGH-EMP-NO OF WGH-IN-REC =                              DESBD315
00154                      WWGH-EMP-NO OF WGH-HOLD-REC                  DESBD315
00155      AND WWGH-SSN OF WGH-IN-REC =                                 DESBD315
00156                   WWGH-SSN OF WGH-HOLD-REC                        DESBD315
00157      AND WWGH-YRQ OF WGH-IN-REC =                                 DESBD315
00158                      WWGH-YRQ OF WGH-HOLD-REC)                    DESBD315
00159         PERFORM P1100-MERGE              THRU P1100-EXIT          DESBD315
00160         PERFORM P1200-READ-NEXT-WWGH     THRU P1200-EXIT          DESBD315
00161      ELSE                                                         DESBD315
00162         PERFORM P1300-WRITE-OUTPUT       THRU P1300-EXIT          DESBD315
00163         MOVE WGH-IN-REC                  TO WGH-HOLD-REC          DESBD315
00164         PERFORM P1200-READ-NEXT-WWGH     THRU P1200-EXIT          DESBD315
00165      END-IF.                                                      DESBD315
00166                                                                   DESBD315
00167  P1000-EXIT.                                                      DESBD315
00168      EXIT.                                                        DESBD315
00169                                                                   DESBD315
00170  P1100-MERGE.                                                     DESBD315
00171      ADD +1                TO WRK-DUPLICATE-CNT.                  DESBD315
00172      ADD  WWGH-EARNINGS OF WGH-IN-REC                             DESBD315
00173                            TO WWGH-EARNINGS OF WGH-HOLD-REC.      DESBD315
00174                                                                   DESBD315
00175 *    DISPLAY 'DUP ' WWGH-SSN OF WGH-HOLD-REC                      DESBD315
00176 *                     '  '  WWGH-EMP-NO OF WGH-HOLD-REC           DESBD315
00177 *                     '  '  WWGH-YRQ    OF WGH-HOLD-REC.          DESBD315
00178                                                                   DESBD315
00179  P1100-EXIT.                                                      DESBD315
00180      EXIT.                                                        DESBD315
00181                                                                   DESBD315
00182  P1200-READ-NEXT-WWGH.                                            DESBD315
00183      READ WAGE-IN-FILE.                                           DESBD315
00184      IF WAGE-IN-OK-88                                             DESBD315
00185         ADD +1                 TO WRK-WWGH-READ-CNT.              DESBD315
00186                                                                   DESBD315
00187  P1200-EXIT.                                                      DESBD315
00188      EXIT.                                                        DESBD315
00189                                                                   DESBD315
00190  P1300-WRITE-OUTPUT.                                              DESBD315
00191      WRITE WGH-OUT-REC        FROM WGH-HOLD-REC.                  DESBD315
00192      ADD +1                   TO WRK-WWGH-WRITE-CNT.              DESBD315
00193  P1300-EXIT.                                                      DESBD315
00194      EXIT.                                                        DESBD315
00195                                                                   DESBD315
00196  T0000-TERMINATE.                                                 DESBD315
00197                                                                   DESBD315
00198      DISPLAY ' '.                                                 DESBD315
00199      DISPLAY ' '.                                                 DESBD315
00200                                                                   DESBD315
00201      DISPLAY '*** DESBD315 TERMINATION STATISTICS ***'.           DESBD315
00202                                                                   DESBD315
00203      DISPLAY '  '.                                                DESBD315
00204      DISPLAY 'WAGE INPUT RECORDS READ                          : 'DESBD315
00205              WRK-WWGH-READ-CNT.                                   DESBD315
00206                                                                   DESBD315
00207      DISPLAY '  '.                                                DESBD315
00208      DISPLAY 'DUPLICATE RECORDS MERGED                         : 'DESBD315
00209              WRK-DUPLICATE-CNT.                                   DESBD315
00210                                                                   DESBD315
00211      DISPLAY '  '.                                                DESBD315
00212      DISPLAY 'OUTPUT RECORDS WRITTEN                           : 'DESBD315
00213              WRK-WWGH-WRITE-CNT.                                  DESBD315
00214                                                                   DESBD315
00215      CLOSE WAGE-IN-FILE  WAGE-OUT-FILE.                           DESBD315
00216                                                                   DESBD315
00217  T0000-EXIT.                                                      DESBD315
00218      EXIT.                                                        DESBD315
