00001  IDENTIFICATION DIVISION.                                         06/17/09
00002  PROGRAM-ID.             DESBD322.                                DESBD322
00003  AUTHOR.                 NGC.                                        LV003
00004  DATE-WRITTEN.           APRIL 2009                               DESBD322
00005  DATE-COMPILED.                                                   DESBD322
00006      SKIP3                                                        DESBD322
00007 *****                                                             DESBD322
00008 *                                                                 DESBD322
00009 *    FUNCTION:  MERGE WORKER NAME RECORDS FROM WAGE FILE (DESBD320DESBD322
00010 *               AND BENEFITS FILE (DESBD321).  WHEN AN SSN EXISTS DESBD322
00011 *               IN BOTH FILES, SELECT THE ONE WITH THE MOST RECENTDESBD322
00012 *               DATE.                                             DESBD322
00013 *                                                                 DESBD322
00014 *    MODIFICATION LOG:                                            DESBD322
00015 *                                                                 DESBD322
00016 *    04/08/2009  INITIAL DEVELOPMENT                              DESBD322
00017 *                WORK ORDER:                      PROGRAMMER: GD  DESBD322
00018 *                                                                 DESBD322
00019 *    99/99/9999  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX DESBD322
00020 *                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX DESBD322
00021 *                WORK ORDER:                      PROGRAMMER: XXX DESBD322
00022 *                                                                 DESBD322
00023 *  DESCRIPTION:                                                   DESBD322
00024 *                                                                 DESBD322
00025 *    INITIATION:                                                  DESBD322
00026 *      INITIAL READ FROM BOTH INPUT FILES                         DESBD322
00027 *                                                                 DESBD322
00028 *    PROCESSING:                                                  DESBD322
00029 *                                                                 DESBD322
00030 *    TERMINATION:                                                 DESBD322
00031 *      CLOSE FILES                                                DESBD322
00032 *                                                                 DESBD322
00033 *    RECORDS READ:                                                DESBD322
00034 *      MASTER:                                                    DESBD322
00035          NONE                                                     DESBD322
00036 *                                                                 DESBD322
00037 *      ALTERNATE INDEX:                                           DESBD322
00038 *        NONE.                                                    DESBD322
00039 *                                                                 DESBD322
00040 *      REFERENCE:                                                 DESBD322
00041 *        NONE.                                                    DESBD322
00042 *                                                                 DESBD322
00043 *    RECORDS UPDATED:                                             DESBD322
00044 *        NONE                                                     DESBD322
00045 *                                                                 DESBD322
00046 *    REPORT RECORDS WRITTEN:                                      DESBD322
00047 *        NONE                                                     DESBD322
00048 *                                                                 DESBD322
00049 *    BATCH TRANSACTION COLLECTION RECORDS WRITTEN:                DESBD322
00050 *        NONE.                                                    DESBD322
00051 *                                                                 DESBD322
00052 *    MODULES CALLED:                                              DESBD322
00053 *        DTSBU001  DATE CONVERSION/EDIT.                          DESBD322
00054 *        DTSBU004  QUARERLY SUMMARY REPORT REC.                   DESBD322
00055 *        DTSBU946  VARIABLE LENGTH RECORDS SEQUENTIAL OUTPUT 1.   DESBD322
00056 *                                                                 DESBD322
00057 *    VERMONT REFERENCE:                                           DESBD322
00058 *        NONE.                                                    DESBD322
00059 *                                                                 DESBD322
00060 *****                                                             DESBD322
00061      SKIP3                                                        DESBD322
00062  ENVIRONMENT DIVISION.                                            DESBD322
00063  INPUT-OUTPUT SECTION.                                            DESBD322
00064      SKIP3                                                        DESBD322
00065  FILE-CONTROL.                                                    DESBD322
00066      SELECT IN-NAME-FILE    ASSIGN TO DESFB320                    DESBD322
00067             FILE STATUS IS IN-NAME-STATUS.                        DESBD322
00068                                                                   DESBD322
00069      SELECT OUT-NAME-FILE   ASSIGN TO DESFB322                    DESBD322
00070             FILE STATUS IS OUT-NAME-STATUS.                       DESBD322
00071                                                                   DESBD322
00072  DATA DIVISION.                                                   DESBD322
00073  FILE SECTION.                                                    DESBD322
00074  FD  IN-NAME-FILE                                                 DESBD322
00075      RECORDING MODE IS F                                          DESBD322
00076      LABEL RECORDS ARE STANDARD                                   DESBD322
00077      BLOCK CONTAINS 0 CHARACTERS.                                 DESBD322
00078      SKIP1                                                        DESBD322
00079  01  IN-NAME-REC.                                                 DESBD322
00080  ++INCLUDE DTSIX147                                               DESBD322
00081                                                                   DESBD322
00082  FD  OUT-NAME-FILE                                                DESBD322
00083      RECORDING MODE IS F                                          DESBD322
00084      LABEL RECORDS ARE STANDARD                                   DESBD322
00085      BLOCK CONTAINS 0 CHARACTERS.                                 DESBD322
00086      SKIP1                                                        DESBD322
00087  01  OUT-NAME-REC                       PIC X(46).                DESBD322
00088                                                                   DESBD322
00089                                                                   DESBD322
00090  WORKING-STORAGE SECTION.                                         DESBD322
000905 77  PAN-VALET PICTURE X(24) VALUE '003DESBD322  06/17/09'.       DESBD322
00091                                                                   DESBD322
00092  01  WRK-AREA.                                                    DESBD322
00093      05  WRK-ABEND-CD                PIC S9(04)  COMP  VALUE +322.DESBD322
00094      05  WRK-MOD-NAME                PIC  X(08)  VALUE 'DESBD322'.DESBD322
00095      05  WRK-ABEND-MSG               PIC  X(60).                  DESBD322
00096                                                                   DESBD322
00097      05  IN-NAME-STATUS              PIC  X(02).                  DESBD322
00098          88  IN-NAME-OK-88                     VALUE '00'.        DESBD322
00099          88  IN-NAME-EOF-88                    VALUE '10'.        DESBD322
00100                                                                   DESBD322
00101      05  OUT-NAME-STATUS             PIC  X(02).                  DESBD322
00102          88  OUT-NAME-OK-88                    VALUE '00'.        DESBD322
00103                                                                   DESBD322
00104      05  WRK-ERROR-IND               PIC  X(01).                  DESBD322
00105          88 WRK-ERROR-YES-88                VALUE 'Y'.            DESBD322
00106          88 WRK-ERROR-NO-88                 VALUE 'N'.            DESBD322
00107                                                                   DESBD322
00108      05  WRK-CURR-SSN                PIC S9(09) COMP-3 VALUE +0.  DESBD322
00109                                                                   DESBD322
00110      05  WRK-READ-CNT                PIC S9(07) COMP-3 VALUE +0.  DESBD322
00111      05  WRK-WRITE-CNT               PIC S9(07) COMP-3 VALUE +0.  DESBD322
00112                                                                   DESBD322
00113      05  AMT-DISP1                   PIC ---------9.99.           DESBD322
00114      05  AMT-DISP2                   PIC ---------9.99.           DESBD322
00115                                                                   DESBD322
00116  01  L001-LINK-AREA.                                              DESBD322
00117  ++INCLUDE DTSIL001                                               DESBD322
00118      EJECT                                                        DESBD322
00119  01  L004-LINK-AREA.                                              DESBD322
00120  ++INCLUDE DTSIL004                                               DESBD322
00121      EJECT                                                        DESBD322
00122  01  L005-LINK-AREA.                                              DESBD322
00123  ++INCLUDE DTSIL005                                               DESBD322
00124      EJECT                                                        DESBD322
00125  PROCEDURE DIVISION.                                              DESBD322
00126       PERFORM I0000-INITIALIZE   THRU I0000-EXIT.                 DESBD322
00127       IF WRK-ERROR-NO-88                                          DESBD322
00128          PERFORM P0000-PROCESS   THRU P0000-EXIT                  DESBD322
00129          PERFORM T0000-TERMINATE THRU T0000-EXIT                  DESBD322
00130       END-IF.                                                     DESBD322
00131                                                                   DESBD322
00132      GOBACK.                                                      DESBD322
00133      EJECT                                                        DESBD322
00134  I0000-INITIALIZE.                                                DESBD322
00135      SET WRK-ERROR-NO-88         TO TRUE.                         DESBD322
00136                                                                   DESBD322
00137      PERFORM I2000-OPEN-FILES    THRU I2000-EXIT.                 DESBD322
00138                                                                   DESBD322
00139  I0000-EXIT.                                                      DESBD322
00140      EXIT.                                                        DESBD322
00141                                                                   DESBD322
00142  I2000-OPEN-FILES.                                                DESBD322
00143      OPEN INPUT IN-NAME-FILE.                                     DESBD322
00144      IF NOT IN-NAME-OK-88                                         DESBD322
00145         DISPLAY 'CANNOT OPEN IN-NAME  ' IN-NAME-STATUS            DESBD322
00146         SET WRK-ERROR-YES-88 TO TRUE                              DESBD322
00147         GO TO I2000-EXIT                                          DESBD322
00148      END-IF.                                                      DESBD322
00149                                                                   DESBD322
00150                                                                   DESBD322
00151      OPEN OUTPUT OUT-NAME-FILE.                                   DESBD322
00152      IF NOT OUT-NAME-OK-88                                        DESBD322
00153         DISPLAY 'CANNOT OPEN OUT-NAME  ' OUT-NAME-STATUS          DESBD322
00154         SET WRK-ERROR-YES-88 TO TRUE                              DESBD322
00155         GO TO I2000-EXIT                                          DESBD322
00156      END-IF.                                                      DESBD322
00157                                                                   DESBD322
00158  I2000-EXIT.                                                      DESBD322
00159      EXIT.                                                        DESBD322
00160                                                                   DESBD322
00161  P0000-PROCESS.                                                   DESBD322
00162      PERFORM S1100-READ-INPUT       THRU S1100-EXIT.              DESBD322
00163      MOVE ZERO                      TO WRK-CURR-SSN.              DESBD322
00164 **   PERFORM S1200-READ-BENEFITS    THRU S1200-EXIT.              DESBD322
00165                                                                   DESBD322
00166      PERFORM P1000-SCAN-NAMES       THRU P1000-EXIT               DESBD322
00167         UNTIL IN-NAME-EOF-88.                                     DESBD322
00168                                                                   DESBD322
00169  P0000-EXIT.                                                      DESBD322
00170      EXIT.                                                        DESBD322
00171                                                                   DESBD322
00172  P1000-SCAN-NAMES.                                                DESBD322
00173      IF X147-SSN NOT = WRK-CURR-SSN                               DESBD322
00174         MOVE X147-SSN                       TO WRK-CURR-SSN       DESBD322
00175         PERFORM S1200-WRITE-OUTPUT          THRU S1200-EXIT       DESBD322
00176      END-IF.                                                      DESBD322
00177                                                                   DESBD322
00178      PERFORM S1100-READ-INPUT               THRU S1100-EXIT.      DESBD322
00179                                                                   DESBD322
00180  P1000-EXIT.                                                      DESBD322
00181      EXIT.                                                        DESBD322
00182                                                                   DESBD322
00183 *P1000-SCAN-NAMES.                                                DESBD322
00184 *    IF WG-NAME-EOF-88                                            DESBD322
00185 *       PERFORM S1210-WRITE-BENEFITS           THRU S1210-EXIT    DESBD322
00186 *       PERFORM S1200-READ-BENEFITS            THRU S1200-EXIT    DESBD322
00187 *       GO TO P1000-EXIT                                          DESBD322
00188 *    END-IF.                                                      DESBD322
00189 *                                                                 DESBD322
00190 *    IF BEN-NAME-EOF-88                                           DESBD322
00191 *       PERFORM S1110-WRITE-WAGE               THRU S1110-EXIT    DESBD322
00192 *       PERFORM S1100-READ-WAGE                THRU S1100-EXIT    DESBD322
00193 *       GO TO P1000-EXIT                                          DESBD322
00194 *    END-IF.                                                      DESBD322
00195 *                                                                 DESBD322
00196 *    IF X147-SSN OF WG-NAME-REC >                                 DESBD322
00197 *       X147-SSN OF BEN-NAME-REC                                  DESBD322
00198 *          PERFORM S1210-WRITE-BENEFITS        THRU S1210-EXIT    DESBD322
00199 *          PERFORM S1200-READ-BENEFITS         THRU S1200-EXIT    DESBD322
00200 *    ELSE                                                         DESBD322
00201 *       IF X147-SSN OF WG-NAME-REC =                              DESBD322
00202 *          X147-SSN OF BEN-NAME-REC                               DESBD322
00203 *          PERFORM P1100-CHECK-NAME            THRU P1100-EXIT    DESBD322
00204 *          PERFORM S1200-READ-BENEFITS         THRU S1200-EXIT    DESBD322
00205 *          PERFORM S1100-READ-WAGE             THRU S1100-EXIT    DESBD322
00206 *       ELSE                                                      DESBD322
00207 *          IF X147-SSN OF WG-NAME-REC <                           DESBD322
00208 *             X147-SSN OF BEN-NAME-REC                            DESBD322
00209 *                PERFORM S1110-WRITE-WAGE      THRU S1110-EXIT    DESBD322
00210 *                PERFORM S1100-READ-WAGE       THRU S1100-EXIT    DESBD322
00211 *          END-IF                                                 DESBD322
00212 *       END-IF                                                    DESBD322
00213 *    END-IF.                                                      DESBD322
00214 *                                                                 DESBD322
00215 *P1000-EXIT.                                                      DESBD322
00216 *    EXIT.                                                        DESBD322
00217                                                                   DESBD322
00218 *P1100-CHECK-NAME.                                                DESBD322
00219 *    IF X147-EFF-DATE OF WG-NAME-REC >=                           DESBD322
00220 *       X147-EFF-DATE OF BEN-NAME-REC                             DESBD322
00221 *       PERFORM S1110-WRITE-WAGE      THRU S1110-EXIT             DESBD322
00222 *    ELSE                                                         DESBD322
00223 *       PERFORM S1210-WRITE-BENEFITS  THRU S1210-EXIT             DESBD322
00224 *    END-IF.                                                      DESBD322
00225 *                                                                 DESBD322
00226 *P1100-EXIT.                                                      DESBD322
00227 *    EXIT.                                                        DESBD322
00228                                                                   DESBD322
00229                                                                   DESBD322
00230  T0000-TERMINATE.                                                 DESBD322
00231                                                                   DESBD322
00232      DISPLAY ' '.                                                 DESBD322
00233      DISPLAY ' '.                                                 DESBD322
00234                                                                   DESBD322
00235      DISPLAY '*** DESBD322 TERMINATION STATISTICS ***'.           DESBD322
00236                                                                   DESBD322
00237      DISPLAY '  '.                                                DESBD322
00238      DISPLAY 'INPUT RECORDS READ                            :'    DESBD322
00239              WRK-READ-CNT.                                        DESBD322
00240      DISPLAY 'OUTPUT RECORDS WRITTENT                       :'    DESBD322
00241              WRK-WRITE-CNT.                                       DESBD322
00242                                                                   DESBD322
00243      CLOSE IN-NAME-FILE                                           DESBD322
00244            OUT-NAME-FILE.                                         DESBD322
00245                                                                   DESBD322
00246  T0000-EXIT.                                                      DESBD322
00247      EXIT.                                                        DESBD322
00248      EJECT                                                        DESBD322
00249                                                                   DESBD322
00250  S001-FROM-FED-8.                                                 DESBD322
00251      SET L001-FROM-FED-8 TO TRUE.                                 DESBD322
00252      GO TO S001-DATE.                                             DESBD322
00253                                                                   DESBD322
00254  S001-FROM-ABS-DAY.                                               DESBD322
00255      SET L001-FROM-ABS-DAY TO TRUE.                               DESBD322
00256      GO TO S001-DATE.                                             DESBD322
00257                                                                   DESBD322
00258  S001-FROM-CAL-6.                                                 DESBD322
00259      SET L001-FROM-CAL-6 TO TRUE.                                 DESBD322
00260      GO TO S001-DATE.                                             DESBD322
00261                                                                   DESBD322
00262  S001-DATE.                                                       DESBD322
00263      CALL 'DTSBU001' USING L001-LINK-AREA.                        DESBD322
00264  S001-EXIT.                                                       DESBD322
00265      EXIT.                                                        DESBD322
00266                                                                   DESBD322
00267  S004-FROM-3.                                                     DESBD322
00268      SET L004-FROM-3        TO TRUE.                              DESBD322
00269      GO TO S004-YRQ.                                              DESBD322
00270                                                                   DESBD322
00271  S004-FROM-5.                                                     DESBD322
00272      SET L004-FROM-5        TO TRUE.                              DESBD322
00273      GO TO S004-YRQ.                                              DESBD322
00274                                                                   DESBD322
00275  S004-YRQ.                                                        DESBD322
00276      CALL 'DTSBU004' USING L004-LINK-AREA.                        DESBD322
00277                                                                   DESBD322
00278  S004-EXIT.                                                       DESBD322
00279      EXIT.                                                        DESBD322
00280                                                                   DESBD322
00281  S005-FROM-SYS.                                                   DESBD322
00282      CALL 'DTSBU005' USING L005-LINK-AREA.                        DESBD322
00283  S005-EXIT.                                                       DESBD322
00284      EXIT.                                                        DESBD322
00285                                                                   DESBD322
00286  S1100-READ-INPUT.                                                DESBD322
00287      READ IN-NAME-FILE.                                           DESBD322
00288      IF IN-NAME-EOF-88                                            DESBD322
00289         DISPLAY 'IN FILE EOF ' IN-NAME-STATUS                     DESBD322
00290      ELSE                                                         DESBD322
00291         IF NOT IN-NAME-OK-88                                      DESBD322
00292            DISPLAY 'IN FILE: BAD READ  ' IN-NAME-STATUS           DESBD322
00293            SET IN-NAME-EOF-88           TO TRUE                   DESBD322
00294         ELSE                                                      DESBD322
00295            ADD +1                       TO WRK-READ-CNT           DESBD322
00296         END-IF                                                    DESBD322
00297      END-IF.                                                      DESBD322
00298                                                                   DESBD322
00299  S1100-EXIT.                                                      DESBD322
00300      EXIT.                                                        DESBD322
00301                                                                   DESBD322
00302  S1200-WRITE-OUTPUT.                                              DESBD322
00303 *&                                                                DESBD322
00304      IF X147-SSN = 147629769 OR 148506562                         DESBD322
00305           OR 213258166 OR 213273853                               DESBD322
00306         DISPLAY 'S1200: ' X147-SSN ' ' X147-LAST-NAME             DESBD322
00307            '  ' X147-FIRST-NAME                                   DESBD322
00308      END-IF.                                                      DESBD322
00309 *&                                                                DESBD322
00310      WRITE OUT-NAME-REC                 FROM IN-NAME-REC.         DESBD322
00311      IF NOT OUT-NAME-OK-88                                        DESBD322
00312         DISPLAY 'CANNOT WRITE OUTPUT REC ' OUT-NAME-STATUS        DESBD322
00313         PERFORM S999-ABEND              THRU S999-EXIT            DESBD322
00314      ELSE                                                         DESBD322
00315         ADD +1                          TO WRK-WRITE-CNT          DESBD322
00316      END-IF.                                                      DESBD322
00317                                                                   DESBD322
00318  S1200-EXIT.                                                      DESBD322
00319      EXIT.                                                        DESBD322
00320                                                                   DESBD322
00321 *S1110-WRITE-WAGE.                                                DESBD322
00322 *&                                                                DESBD322
00323 *    IF X147-SSN OF WG-NAME-REC = 041823857 OR 090464763          DESBD322
00324 *         OR 133629737 OR 214722967 OR 217724644                  DESBD322
00325 *       DISPLAY 'S1110: ' X147-SSN OF WG-NAME-REC                 DESBD322
00326 *    END-IF.                                                      DESBD322
00327 *&                                                                DESBD322
00328 *    WRITE OUT-NAME-REC                 FROM WG-NAME-REC.         DESBD322
00329 *    IF NOT OUT-NAME-OK-88                                        DESBD322
00330 *       DISPLAY 'CANNOT WRITE OUTPUT REC ' OUT-NAME-STATUS        DESBD322
00331 *       PERFORM S999-ABEND              THRU S999-EXIT            DESBD322
00332 *    ELSE                                                         DESBD322
00333 *       ADD +1                          TO WRK-WAGE-OUT-CNT       DESBD322
00334 *    END-IF.                                                      DESBD322
00335 *                                                                 DESBD322
00336 *S1110-EXIT.                                                      DESBD322
00337 *    EXIT.                                                        DESBD322
00338 *                                                                 DESBD322
00339 *S1200-READ-BENEFITS.                                             DESBD322
00340 *    READ BEN-NAME-FILE.                                          DESBD322
00341 *    IF BEN-NAME-EOF-88                                           DESBD322
00342 *       DISPLAY 'BEN FILE EOF ' BEN-NAME-STATUS                   DESBD322
00343 *    ELSE                                                         DESBD322
00344 *       IF NOT BEN-NAME-OK-88                                     DESBD322
00345 *          DISPLAY 'BEN FILE: BAD READ  ' BEN-NAME-STATUS         DESBD322
00346 *          SET WG-NAME-EOF-88           TO TRUE                   DESBD322
00347 *          SET BEN-NAME-EOF-88          TO TRUE                   DESBD322
00348 *       ELSE                                                      DESBD322
00349 *          ADD +1                       TO WRK-BEN-IN-CNT         DESBD322
00350 *       END-IF                                                    DESBD322
00351 *    END-IF.                                                      DESBD322
00352 *                                                                 DESBD322
00353 *S1200-EXIT.                                                      DESBD322
00354 *    EXIT.                                                        DESBD322
00355 *                                                                 DESBD322
00356 *S1210-WRITE-BENEFITS.                                            DESBD322
00357 *&                                                                DESBD322
00358 *    IF X147-SSN OF BEN-NAME-REC = 041823857 OR 090464763         DESBD322
00359 *         OR 133629737 OR 214722967 OR 217724644                  DESBD322
00360 *       DISPLAY 'S1210: ' X147-SSN OF BEN-NAME-REC                DESBD322
00361 *    END-IF.                                                      DESBD322
00362 *&                                                                DESBD322
00363 *    WRITE OUT-NAME-REC                 FROM BEN-NAME-REC.        DESBD322
00364 *    IF NOT OUT-NAME-OK-88                                        DESBD322
00365 *       DISPLAY 'CANNOT WRITE OUTPUT REC ' OUT-NAME-STATUS        DESBD322
00366 *       PERFORM S999-ABEND              THRU S999-EXIT            DESBD322
00367 *    ELSE                                                         DESBD322
00368 *       ADD +1                          TO WRK-BEN-OUT-CNT        DESBD322
00369 *    END-IF.                                                      DESBD322
00370 *                                                                 DESBD322
00371 *S1210-EXIT.                                                      DESBD322
00372 *    EXIT.                                                        DESBD322
00373                                                                   DESBD322
00374  S999-ABEND.                                                      DESBD322
00375      DISPLAY '*** DESBD322 ABENDING : '                           DESBD322
00376              WRK-ABEND-MSG.                                       DESBD322
00377                                                                   DESBD322
00378      CALL 'DTSBU999' USING WRK-ABEND-CD.                          DESBD322
00379  S999-EXIT.                                                       DESBD322
00380      EXIT.                                                        DESBD322
