00001  IDENTIFICATION DIVISION.                                         08/17/06
00002  PROGRAM-ID.             DTSBX462.                                DTSBX462
00003  AUTHOR.                 NGC.                                        LV003
00004  DATE-WRITTEN.           JANUARY 2005.                            DTSBX462
00005  DATE-COMPILED.                                                   DTSBX462
00006      SKIP3                                                        DTSBX462
00007 *****                                                             DTSBX462
00008 *                                                                 DTSBX462
00009 *    >>> BROUGHT TO DEVL TO CHECK ABEND. 08/14/2006 GD            DTSBX462
00010 *                                                                 DTSBX462
00011 *    FUNCTION:  MERGE OTR AND UI TAX EMPLOYER DATA AND PRODUCE    DTSBX462
00012 *               OUTPUT FILE FOR VOS STAFF.                        DTSBX462
00013 *                                                                 DTSBX462
00014 *                                                                 DTSBX462
00015 *  MODIFICATION LOG:                                              DTSBX462
00016 *                                                                 DTSBX462
00017 *    01/11/2005  INITIAL DEVELOPMENT.                             DTSBX462
00018 *                REFERENCE:                      PROGRAMMER: GD   DTSBX462
00019 *                                                                 DTSBX462
00020 *****                                                             DTSBX462
00021      SKIP3                                                        DTSBX462
00022  ENVIRONMENT DIVISION.                                            DTSBX462
00023      SKIP2                                                        DTSBX462
00024  INPUT-OUTPUT SECTION.                                            DTSBX462
00025  FILE-CONTROL.                                                    DTSBX462
00026      SELECT EMP-INPUT-FILE                                        DTSBX462
00027         ASSIGN TO EMPINP                                          DTSBX462
00028         FILE STATUS IS EMP-INP-STATUS.                            DTSBX462
00029                                                                   DTSBX462
00030      SELECT TAX-INPUT-FILE                                        DTSBX462
00031         ASSIGN TO TAXINP                                          DTSBX462
00032         FILE STATUS IS TAX-INP-STATUS.                            DTSBX462
00033                                                                   DTSBX462
00034      SELECT EMP-OUTPUT-FILE                                       DTSBX462
00035         ASSIGN TO EMPOUTP                                         DTSBX462
00036         FILE STATUS IS EMP-OUTP-STATUS.                           DTSBX462
00037                                                                   DTSBX462
00038      SELECT ADDR-OUTPUT-FILE                                      DTSBX462
00039         ASSIGN TO ADDROUTP                                        DTSBX462
00040         FILE STATUS IS ADDR-OUTP-STATUS.                          DTSBX462
00041                                                                   DTSBX462
00042  DATA DIVISION.                                                   DTSBX462
00043      SKIP3                                                        DTSBX462
00044  FILE SECTION.                                                    DTSBX462
00045                                                                   DTSBX462
00046  FD  EMP-INPUT-FILE                                               DTSBX462
00047      LABEL RECORDS ARE STANDARD                                   DTSBX462
00048      BLOCK CONTAINS 0 RECORDS                                     DTSBX462
00049      RECORDING MODE IS F.                                         DTSBX462
00050                                                                   DTSBX462
00051  01  EMP-INPUT-REC                   PIC X(290).                  DTSBX462
00052                                                                   DTSBX462
00053  FD  TAX-INPUT-FILE                                               DTSBX462
00054      LABEL RECORDS ARE STANDARD                                   DTSBX462
00055      BLOCK CONTAINS 0 RECORDS                                     DTSBX462
00056      RECORDING MODE IS F.                                         DTSBX462
00057                                                                   DTSBX462
00058  01  TAX-INPUT-REC                   PIC X(290).                  DTSBX462
00059                                                                   DTSBX462
00060  FD  EMP-OUTPUT-FILE                                              DTSBX462
00061      LABEL RECORDS ARE STANDARD                                   DTSBX462
00062      BLOCK CONTAINS 0 RECORDS                                     DTSBX462
00063      RECORDING MODE IS F.                                         DTSBX462
00064                                                                   DTSBX462
00065  01  EMP-OUTPUT-REC                  PIC X(89).                   DTSBX462
00066                                                                   DTSBX462
00067  FD  ADDR-OUTPUT-FILE                                             DTSBX462
00068      LABEL RECORDS ARE STANDARD                                   DTSBX462
00069      BLOCK CONTAINS 0 RECORDS                                     DTSBX462
00070      RECORDING MODE IS F.                                         DTSBX462
00071                                                                   DTSBX462
00072  01  ADDR-OUTPUT-REC                 PIC X(128).                  DTSBX462
00073                                                                   DTSBX462
00074      EJECT                                                        DTSBX462
00075  WORKING-STORAGE SECTION.                                         DTSBX462
000755 77  PAN-VALET PICTURE X(24) VALUE '003DTSBX462  08/17/06'.       DTSBX462
00076      SKIP3                                                        DTSBX462
00077  01  WRK-AREA.                                                    DTSBX462
00078      05  WRK-ABEND-CD                PIC S9(04)  COMP  VALUE +462.DTSBX462
00079                                                                   DTSBX462
00080      05  WRK-MOD-NAME                PIC  X(08)  VALUE 'DTSBX462'.DTSBX462
00081                                                                   DTSBX462
00082      05  WRK-EMP-IN-CNT              PIC S9(07)  COMP-3 VALUE 0.  DTSBX462
00083      05  WRK-TAX-IN-CNT              PIC S9(07)  COMP-3 VALUE 0.  DTSBX462
00084      05  WRK-EMP-OUT-CNT             PIC S9(07)  COMP-3 VALUE 0.  DTSBX462
00085      05  WRK-ADDR-OUT-CNT            PIC S9(07)  COMP-3 VALUE 0.  DTSBX462
00086      05  WRK-EMP-UNMATCH-CNT         PIC S9(07)  COMP-3 VALUE 0.  DTSBX462
00087      05  WRK-TAX-UNMATCH-CNT         PIC S9(07)  COMP-3 VALUE 0.  DTSBX462
00088      05  WRK-EMP-TAX-MATCH-CNT       PIC S9(07)  COMP-3 VALUE 0.  DTSBX462
00089                                                                   DTSBX462
00090      05  EMP-INP-STATUS               PIC  X(02).                 DTSBX462
00091          88  EMP-INP-STATUS-OK-88    VALUE '00', '97'.            DTSBX462
00092          88  EMP-INP-STATUS-EOF-88   VALUE '10'.                  DTSBX462
00093                                                                   DTSBX462
00094      05  TAX-INP-STATUS               PIC  X(02).                 DTSBX462
00095          88  TAX-INP-STATUS-OK-88    VALUE '00', '97'.            DTSBX462
00096          88  TAX-INP-STATUS-EOF-88   VALUE '10'.                  DTSBX462
00097                                                                   DTSBX462
00098      05  EMP-OUTP-STATUS              PIC  X(02).                 DTSBX462
00099          88  EMP-OUTP-STATUS-OK-88   VALUE '00', '97'.            DTSBX462
00100                                                                   DTSBX462
00101      05  ADDR-OUTP-STATUS              PIC  X(02).                DTSBX462
00102          88  ADDR-OUTP-STATUS-OK-88   VALUE '00', '97'.           DTSBX462
00103                                                                   DTSBX462
00104      05  WRK-ERROR-IND               PIC  X(01).                  DTSBX462
00105          88 WRK-ERROR-YES-88        VALUE 'Y'.                    DTSBX462
00106          88 WRK-ERROR-NO-88         VALUE 'N'.                    DTSBX462
00107                                                                   DTSBX462
00108      05  WRK-EMP-NO                      PIC  9(06)  VALUE 0.     DTSBX462
00109                                                                   DTSBX462
00110      05  WRK-FEIN                        PIC  9(09)  VALUE 0.     DTSBX462
00111      05  SAVE-TAX-FEIN                   PIC  9(09)  VALUE 0.     DTSBX462
00112      05  SAVE-EMP-FEIN                   PIC  9(09)  VALUE 0.     DTSBX462
00113                                                                   DTSBX462
00114      05  WRK-PHONE.                                               DTSBX462
00115          10  WRK-PHONE-AREA              PIC  X(03).              DTSBX462
00116          10  WRK-PHONE-PFX               PIC  X(03).              DTSBX462
00117          10  WRK-PHONE-SFX               PIC  X(04).              DTSBX462
00118          10  WRK-PHONE-EXT               PIC  X(05).              DTSBX462
00119                                                                   DTSBX462
00120      05  WRK-XVAD-PHONE.                                          DTSBX462
00121          10  WRK-XVAD-PHONE-AREA         PIC  X(03).              DTSBX462
00122          10  WRK-XVAD-PHONE-FILLER1      PIC  X(01) VALUE SPACE.  DTSBX462
00123          10  WRK-XVAD-PHONE-PFX          PIC  X(03).              DTSBX462
00124          10  WRK-XVAD-PHONE-FILLER2      PIC  X(01) VALUE SPACE.  DTSBX462
00125          10  WRK-XVAD-PHONE-SFX          PIC  X(04).              DTSBX462
00126          10  WRK-XVAD-PHONE-FILLER3      PIC  X(01) VALUE SPACE.  DTSBX462
00127          10  WRK-XVAD-PHONE-EXT          PIC  X(05).              DTSBX462
00128                                                                   DTSBX462
00129      05  WRK-TRACE-IND                   PIC  X(01)  VALUE SPACES.DTSBX462
00130                                                                   DTSBX462
00131  01  EMP-INPUT-RECORD.                                            DTSBX462
00132      05  EMPL-FEIN                   PIC 9(09).                   DTSBX462
00133      05  EMPL-EMP-NO                 PIC 9(06).                   DTSBX462
00134      05  EMPL-SOURCE                 PIC X(01).                   DTSBX462
00135          88  EMPL-SOURCE-DOES-88      VALUE '0'.                  DTSBX462
00136          88  EMPL-SOURCE-NEWHIRE-88   VALUE '1'.                  DTSBX462
00137          88  EMPL-SOURCE-OTR-88       VALUE '2'.                  DTSBX462
00138      05  EMPL-EMP-NAME               PIC X(70).                   DTSBX462
00139      05  EMPL-ADDRESS-1.                                          DTSBX462
00140          10  EMPL-STREET-1           PIC X(60).                   DTSBX462
00141          10  EMPL-CITY-1             PIC X(20).                   DTSBX462
00142          10  EMPL-STATE-1            PIC X(02).                   DTSBX462
00143          10  EMPL-ZIP-1              PIC X(10).                   DTSBX462
00144      05  EMPL-PHONE-1                PIC X(10).                   DTSBX462
00145      05  EMPL-ADDRESS-2.                                          DTSBX462
00146          10  EMPL-STREET-2           PIC X(60).                   DTSBX462
00147          10  EMPL-CITY-2             PIC X(20).                   DTSBX462
00148          10  EMPL-STATE-2            PIC X(02).                   DTSBX462
00149          10  EMPL-ZIP-2              PIC X(10).                   DTSBX462
00150      05  EMPL-PHONE-2                PIC X(10).                   DTSBX462
00151                                                                   DTSBX462
00152  01  TAX-INPUT-RECORD.                                            DTSBX462
00153  ++INCLUDE DTSIXTRO                                               DTSBX462
00154                                                                   DTSBX462
00155  01  WRK-XVEM-REC.                                                DTSBX462
00156  ++INCLUDE DTSIXVEM                                               DTSBX462
00157                                                                   DTSBX462
00158  01  WRK-XVAD-REC.                                                DTSBX462
00159  ++INCLUDE DTSIXVAD                                               DTSBX462
00160      EJECT                                                        DTSBX462
00161                                                                   DTSBX462
00162  PROCEDURE DIVISION.                                              DTSBX462
00163                                                                   DTSBX462
00164  DTSBX462-MAIN.                                                   DTSBX462
00165      PERFORM I1000-INITIATE      THRU I1000-EXIT.                 DTSBX462
00166                                                                   DTSBX462
00167      PERFORM P1000-MATCH-PROCESS THRU P1000-EXIT  UNTIL           DTSBX462
00168        EMP-INP-STATUS-EOF-88 AND TAX-INP-STATUS-EOF-88.           DTSBX462
00169                                                                   DTSBX462
00170      PERFORM T1000-TERMINATE   THRU T1000-EXIT.                   DTSBX462
00171                                                                   DTSBX462
00172  DTSBX462-MAIN-EXIT.                                              DTSBX462
00173      GOBACK.                                                      DTSBX462
00174                                                                   DTSBX462
00175  I1000-INITIATE.                                                  DTSBX462
00176                                                                   DTSBX462
00177      OPEN INPUT EMP-INPUT-FILE.                                   DTSBX462
00178      IF NOT EMP-INP-STATUS-OK-88                                  DTSBX462
00179         DISPLAY 'CANNOT OPEN EMP INPUT FILE ' EMP-INP-STATUS      DTSBX462
00180         PERFORM S999-ABEND THRU S999-EXIT                         DTSBX462
00181      END-IF.                                                      DTSBX462
00182                                                                   DTSBX462
00183      OPEN INPUT TAX-INPUT-FILE.                                   DTSBX462
00184      IF NOT TAX-INP-STATUS-OK-88                                  DTSBX462
00185         DISPLAY 'CANNOT OPEN TAX INPUT FILE ' TAX-INP-STATUS      DTSBX462
00186         PERFORM S999-ABEND THRU S999-EXIT                         DTSBX462
00187      END-IF.                                                      DTSBX462
00188                                                                   DTSBX462
00189      OPEN OUTPUT EMP-OUTPUT-FILE.                                 DTSBX462
00190      IF NOT EMP-OUTP-STATUS-OK-88                                 DTSBX462
00191         DISPLAY 'CANNOT OPEN EMP OUTPUT FILE '                    DTSBX462
00192             EMP-OUTP-STATUS                                       DTSBX462
00193         PERFORM S999-ABEND THRU S999-EXIT                         DTSBX462
00194      END-IF.                                                      DTSBX462
00195                                                                   DTSBX462
00196      OPEN OUTPUT ADDR-OUTPUT-FILE.                                DTSBX462
00197      IF NOT ADDR-OUTP-STATUS-OK-88                                DTSBX462
00198         DISPLAY 'CANNOT OPEN ADDR OUTPUT FILE '                   DTSBX462
00199             ADDR-OUTP-STATUS                                      DTSBX462
00200         PERFORM S999-ABEND THRU S999-EXIT                         DTSBX462
00201      END-IF.                                                      DTSBX462
00202                                                                   DTSBX462
00203      PERFORM P3000-READ-TAX-FILE THRU P3000-EXIT.                 DTSBX462
00204      PERFORM P4000-READ-EMP-FILE THRU P4000-EXIT.                 DTSBX462
00205                                                                   DTSBX462
00206  I1000-EXIT.                                                      DTSBX462
00207      EXIT.                                                        DTSBX462
00208                                                                   DTSBX462
00209  P1000-MATCH-PROCESS.                                             DTSBX462
00210                                                                   DTSBX462
00211      IF XTRO-FEIN < EMPL-FEIN                                     DTSBX462
00212         MOVE XTRO-FEIN                     TO WRK-FEIN            DTSBX462
00213         ADD +1 TO WRK-TAX-UNMATCH-CNT                             DTSBX462
00214         IF XTRO-FEIN NOT = SAVE-TAX-FEIN                          DTSBX462
00215            PERFORM P2000-WRITE-FROM-TAX    THRU P2000-EXIT        DTSBX462
00216            PERFORM P2200-WRITE-TAX-ADDR    THRU P2200-EXIT        DTSBX462
00217         ELSE                                                      DTSBX462
00218            PERFORM P2200-WRITE-TAX-ADDR    THRU P2200-EXIT        DTSBX462
00219         END-IF                                                    DTSBX462
00220         MOVE XTRO-FEIN                     TO SAVE-TAX-FEIN       DTSBX462
00221         IF TAX-INP-STATUS-EOF-88                                  DTSBX462
00222            PERFORM P4000-READ-EMP-FILE     THRU P4000-EXIT        DTSBX462
00223         ELSE                                                      DTSBX462
00224            PERFORM P3000-READ-TAX-FILE THRU P3000-EXIT            DTSBX462
00225         END-IF                                                    DTSBX462
00226      ELSE                                                         DTSBX462
00227         IF XTRO-FEIN = EMPL-FEIN                                  DTSBX462
00228            MOVE XTRO-FEIN                  TO WRK-FEIN            DTSBX462
00229            ADD +1 TO WRK-EMP-TAX-MATCH-CNT                        DTSBX462
00230            IF XTRO-FEIN NOT = SAVE-TAX-FEIN                       DTSBX462
00231               PERFORM P2000-WRITE-FROM-TAX THRU P2000-EXIT        DTSBX462
00232               PERFORM P2200-WRITE-TAX-ADDR THRU P2200-EXIT        DTSBX462
00233               PERFORM P3200-WRITE-EMP-ADDR THRU P3200-EXIT        DTSBX462
00234            ELSE                                                   DTSBX462
00235               PERFORM P2200-WRITE-TAX-ADDR THRU P2200-EXIT        DTSBX462
00236               PERFORM P3200-WRITE-EMP-ADDR THRU P3200-EXIT        DTSBX462
00237            END-IF                                                 DTSBX462
00238            MOVE XTRO-FEIN                  TO SAVE-TAX-FEIN       DTSBX462
00239            MOVE EMPL-FEIN                  TO SAVE-EMP-FEIN       DTSBX462
00240            PERFORM P3000-READ-TAX-FILE     THRU P3000-EXIT        DTSBX462
00241            PERFORM P4000-READ-EMP-FILE     THRU P4000-EXIT        DTSBX462
00242         ELSE                                                      DTSBX462
00243            MOVE EMPL-FEIN                     TO WRK-FEIN         DTSBX462
00244            ADD +1 TO WRK-EMP-UNMATCH-CNT                          DTSBX462
00245            IF EMPL-FEIN NOT = SAVE-EMP-FEIN                       DTSBX462
00246               PERFORM P3100-WRITE-FROM-EMPL   THRU P3100-EXIT     DTSBX462
00247               PERFORM P3200-WRITE-EMP-ADDR    THRU P3200-EXIT     DTSBX462
00248            ELSE                                                   DTSBX462
00249               PERFORM P3200-WRITE-EMP-ADDR    THRU P3200-EXIT     DTSBX462
00250            END-IF                                                 DTSBX462
00251            MOVE EMPL-FEIN                     TO SAVE-EMP-FEIN    DTSBX462
00252            PERFORM P4000-READ-EMP-FILE        THRU P4000-EXIT     DTSBX462
00253         END-IF                                                    DTSBX462
00254      END-IF.                                                      DTSBX462
00255                                                                   DTSBX462
00256  P1000-EXIT.                                                      DTSBX462
00257      EXIT.                                                        DTSBX462
00258                                                                   DTSBX462
00259  P2000-WRITE-FROM-TAX.                                            DTSBX462
00260      MOVE WRK-FEIN                    TO XVEM-FEIN.               DTSBX462
00261      SET XVEM-SOURCE-DOES-88          TO TRUE.                    DTSBX462
00262      MOVE XTRO-EMP-NO                 TO XVEM-EMP-NO.             DTSBX462
00263      MOVE XTRO-EMP-NAME               TO XVEM-EMP-NAME.           DTSBX462
00264      INSPECT XVEM-EMP-NAME REPLACING ALL ',' BY SPACE.            DTSBX462
00265                                                                   DTSBX462
00266      PERFORM S1310-WRITE-OUTPUT-EMP   THRU S1310-EXIT.            DTSBX462
00267                                                                   DTSBX462
00268  P2000-EXIT.                                                      DTSBX462
00269      EXIT.                                                        DTSBX462
00270                                                                   DTSBX462
00271  P2200-WRITE-TAX-ADDR.                                            DTSBX462
00272      MOVE WRK-FEIN                    TO XVAD-FEIN.               DTSBX462
00273      SET XVAD-SOURCE-DOES-88          TO TRUE.                    DTSBX462
00274                                                                   DTSBX462
00275      MOVE XTRO-STREET-1               TO XVAD-STREET.             DTSBX462
00276      INSPECT XVAD-STREET    REPLACING ALL ',' BY SPACE.           DTSBX462
00277                                                                   DTSBX462
00278      MOVE XTRO-CITY-1       TO XVAD-CITY.                         DTSBX462
00279      MOVE XTRO-STATE-1      TO XVAD-STATE.                        DTSBX462
00280      MOVE XTRO-ZIP-1        TO XVAD-ZIP.                          DTSBX462
00281                                                                   DTSBX462
00282      MOVE XTRO-PHONE-1      TO WRK-PHONE.                         DTSBX462
00283      PERFORM S2100-FORMAT-PHONE-TAX  THRU S2100-EXIT.             DTSBX462
00284      MOVE WRK-XVAD-PHONE    TO XVAD-PHONE.                        DTSBX462
00285                                                                   DTSBX462
00286      PERFORM S1410-WRITE-OUTPUT-ADDR  THRU S1410-EXIT.            DTSBX462
00287      MOVE SPACES TO XVAD-PHONE.                                   DTSBX462
00288                                                                   DTSBX462
00289      IF (XTRO-STREET-2 > SPACES                                   DTSBX462
00290          AND XTRO-CITY-2 > SPACES                                 DTSBX462
00291            AND XTRO-STATE-2 > SPACES)                             DTSBX462
00292         MOVE XTRO-STREET-2               TO XVAD-STREET           DTSBX462
00293         INSPECT XVAD-STREET   REPLACING ALL ',' BY SPACE          DTSBX462
00294         MOVE XTRO-CITY-2                 TO XVAD-CITY             DTSBX462
00295         MOVE XTRO-STATE-2                TO XVAD-STATE            DTSBX462
00296         MOVE XTRO-ZIP-2                  TO XVAD-ZIP              DTSBX462
00297         MOVE XTRO-PHONE-2                TO WRK-PHONE             DTSBX462
00298         PERFORM S2100-FORMAT-PHONE-TAX   THRU S2100-EXIT          DTSBX462
00299         MOVE WRK-XVAD-PHONE              TO XVAD-PHONE            DTSBX462
00300         PERFORM S1410-WRITE-OUTPUT-ADDR  THRU S1410-EXIT          DTSBX462
00301         MOVE SPACES TO XVAD-PHONE                                 DTSBX462
00302      END-IF.                                                      DTSBX462
00303                                                                   DTSBX462
00304  P2200-EXIT.                                                      DTSBX462
00305      EXIT.                                                        DTSBX462
00306                                                                   DTSBX462
00307  P3000-READ-TAX-FILE.                                             DTSBX462
00308 *&                                                                DTSBX462
00309      IF TAX-INP-STATUS-EOF-88                                     DTSBX462
00310         DISPLAY 'EOF XTRO ' XTRO-FEIN '  EMP ' EMPL-FEIN          DTSBX462
00311         GO TO P3000-EXIT                                          DTSBX462
00312      END-IF.                                                      DTSBX462
00313 *&                                                                DTSBX462
00314                                                                   DTSBX462
00315      READ TAX-INPUT-FILE INTO  TAX-INPUT-RECORD.                  DTSBX462
00316                                                                   DTSBX462
00317      IF TAX-INP-STATUS-OK-88                                      DTSBX462
00318         NEXT SENTENCE                                             DTSBX462
00319      ELSE                                                         DTSBX462
00320         IF TAX-INP-STATUS-EOF-88                                  DTSBX462
00321 ***        MOVE 999999999 TO XTRO-FEIN                            DTSBX462
00322            GO TO P3000-EXIT                                       DTSBX462
00323         ELSE                                                      DTSBX462
00324            DISPLAY 'BAD TAX FILE READ ' TAX-INP-STATUS            DTSBX462
00325            PERFORM S999-ABEND THRU S999-EXIT.                     DTSBX462
00326                                                                   DTSBX462
00327      ADD +1 TO WRK-TAX-IN-CNT.                                    DTSBX462
00328                                                                   DTSBX462
00329  P3000-EXIT.                                                      DTSBX462
00330      EXIT.                                                        DTSBX462
00331                                                                   DTSBX462
00332  P3100-WRITE-FROM-EMPL.                                           DTSBX462
00333      MOVE WRK-FEIN                    TO XVEM-FEIN.               DTSBX462
00334      MOVE EMPL-SOURCE                 TO XVEM-SOURCE.             DTSBX462
00335      MOVE SPACES                      TO XVEM-EMP-NO.             DTSBX462
00336      MOVE EMPL-EMP-NAME               TO XVEM-EMP-NAME.           DTSBX462
00337      INSPECT XVEM-EMP-NAME REPLACING ALL ',' BY SPACE.            DTSBX462
00338                                                                   DTSBX462
00339      PERFORM S1310-WRITE-OUTPUT-EMP   THRU S1310-EXIT.            DTSBX462
00340                                                                   DTSBX462
00341  P3100-EXIT.                                                      DTSBX462
00342      EXIT.                                                        DTSBX462
00343                                                                   DTSBX462
00344  P3200-WRITE-EMP-ADDR.                                            DTSBX462
00345      MOVE WRK-FEIN                    TO XVAD-FEIN.               DTSBX462
00346      MOVE EMPL-SOURCE                 TO XVAD-SOURCE.             DTSBX462
00347                                                                   DTSBX462
00348      MOVE EMPL-STREET-1               TO XVAD-STREET.             DTSBX462
00349      INSPECT XVAD-STREET   REPLACING ALL ',' BY SPACE.            DTSBX462
00350      MOVE EMPL-CITY-1                 TO XVAD-CITY.               DTSBX462
00351      MOVE EMPL-STATE-1                TO XVAD-STATE.              DTSBX462
00352      MOVE EMPL-ZIP-1                  TO XVAD-ZIP.                DTSBX462
00353      MOVE EMPL-PHONE-1                TO WRK-PHONE.               DTSBX462
00354      PERFORM S2100-FORMAT-PHONE-TAX   THRU S2100-EXIT.            DTSBX462
00355      MOVE WRK-XVAD-PHONE              TO XVAD-PHONE.              DTSBX462
00356                                                                   DTSBX462
00357      PERFORM S1410-WRITE-OUTPUT-ADDR  THRU S1410-EXIT.            DTSBX462
00358      MOVE SPACES TO XVAD-PHONE.                                   DTSBX462
00359                                                                   DTSBX462
00360      IF (EMPL-STREET-2 > SPACES                                   DTSBX462
00361          AND EMPL-CITY-2 > SPACES                                 DTSBX462
00362            AND EMPL-STATE-2 > SPACES)                             DTSBX462
00363         MOVE EMPL-STREET-2               TO XVAD-STREET           DTSBX462
00364         INSPECT XVAD-STREET   REPLACING ALL ',' BY SPACE          DTSBX462
00365         MOVE EMPL-CITY-2                 TO XVAD-CITY             DTSBX462
00366         MOVE EMPL-STATE-2                TO XVAD-STATE            DTSBX462
00367         MOVE EMPL-ZIP-2                  TO XVAD-ZIP              DTSBX462
00368         MOVE EMPL-PHONE-2                TO WRK-PHONE             DTSBX462
00369         PERFORM S2100-FORMAT-PHONE-TAX   THRU S2100-EXIT          DTSBX462
00370         MOVE WRK-XVAD-PHONE              TO XVAD-PHONE            DTSBX462
00371         PERFORM S1410-WRITE-OUTPUT-ADDR  THRU S1410-EXIT          DTSBX462
00372         MOVE SPACES TO XVAD-PHONE                                 DTSBX462
00373      END-IF.                                                      DTSBX462
00374                                                                   DTSBX462
00375  P3200-EXIT.                                                      DTSBX462
00376      EXIT.                                                        DTSBX462
00377                                                                   DTSBX462
00378  P4000-READ-EMP-FILE.                                             DTSBX462
00379                                                                   DTSBX462
00380      READ EMP-INPUT-FILE INTO  EMP-INPUT-RECORD.                  DTSBX462
00381                                                                   DTSBX462
00382      IF EMP-INP-STATUS-OK-88                                      DTSBX462
00383         NEXT SENTENCE                                             DTSBX462
00384      ELSE                                                         DTSBX462
00385         IF EMP-INP-STATUS-EOF-88                                  DTSBX462
00386            MOVE 999999999 TO EMPL-FEIN                            DTSBX462
00387            GO TO P4000-EXIT                                       DTSBX462
00388         ELSE                                                      DTSBX462
00389            DISPLAY 'BAD EMP FILE READ ' EMP-INP-STATUS            DTSBX462
00390            PERFORM S999-ABEND THRU S999-EXIT.                     DTSBX462
00391                                                                   DTSBX462
00392      ADD +1 TO WRK-EMP-IN-CNT.                                    DTSBX462
00393                                                                   DTSBX462
00394  P4000-EXIT.                                                      DTSBX462
00395      EXIT.                                                        DTSBX462
00396                                                                   DTSBX462
00397  T1000-TERMINATE.                                                 DTSBX462
00398                                                                   DTSBX462
00399      DISPLAY ' '.                                                 DTSBX462
00400                                                                   DTSBX462
00401      DISPLAY '*** DTSBX462 TERMINATION STATISTICS ***'.           DTSBX462
00402                                                                   DTSBX462
00403      DISPLAY ' '.                                                 DTSBX462
00404                                                                   DTSBX462
00405      DISPLAY 'NUMBER OF EMP INPUT RECORDS READ        : '         DTSBX462
00406              WRK-EMP-IN-CNT.                                      DTSBX462
00407                                                                   DTSBX462
00408      DISPLAY 'NUMBER OF TAX INPUT RECORDS READ        : '         DTSBX462
00409              WRK-TAX-IN-CNT.                                      DTSBX462
00410                                                                   DTSBX462
00411      DISPLAY 'NUMBER OF EMP OUTPUT RECORDS WRITTEN    : '         DTSBX462
00412              WRK-EMP-OUT-CNT.                                     DTSBX462
00413                                                                   DTSBX462
00414      DISPLAY 'NUMBER OF ADDR OUTPUT RECORDS WRITTEN   : '         DTSBX462
00415              WRK-ADDR-OUT-CNT.                                    DTSBX462
00416                                                                   DTSBX462
00417      DISPLAY ' '.                                                 DTSBX462
00418                                                                   DTSBX462
00419      DISPLAY 'NUMBER OF EMP AND TAX RECORDS MATCHED   : '         DTSBX462
00420              WRK-EMP-TAX-MATCH-CNT.                               DTSBX462
00421                                                                   DTSBX462
00422      DISPLAY 'NUMBER OF EMP RECORDS UN-MATCHED        : '         DTSBX462
00423              WRK-EMP-UNMATCH-CNT.                                 DTSBX462
00424                                                                   DTSBX462
00425      DISPLAY 'NUMBER OF TAX RECORDS UN-MATCHED        : '         DTSBX462
00426              WRK-TAX-UNMATCH-CNT.                                 DTSBX462
00427                                                                   DTSBX462
00428      CLOSE EMP-INPUT-FILE                                         DTSBX462
00429            TAX-INPUT-FILE                                         DTSBX462
00430            EMP-OUTPUT-FILE                                        DTSBX462
00431            ADDR-OUTPUT-FILE.                                      DTSBX462
00432                                                                   DTSBX462
00433  T1000-EXIT.                                                      DTSBX462
00434      EXIT.                                                        DTSBX462
00435                                                                   DTSBX462
00436  S1310-WRITE-OUTPUT-EMP.                                          DTSBX462
00437      WRITE EMP-OUTPUT-REC FROM WRK-XVEM-REC.                      DTSBX462
00438      IF NOT EMP-OUTP-STATUS-OK-88                                 DTSBX462
00439         DISPLAY 'S1310 BAD WRITE ON EMP OUTPUT '                  DTSBX462
00440                  EMP-OUTP-STATUS                                  DTSBX462
00441         PERFORM S999-ABEND THRU S999-EXIT                         DTSBX462
00442      ELSE                                                         DTSBX462
00443         ADD +1 TO WRK-EMP-OUT-CNT                                 DTSBX462
00444      END-IF.                                                      DTSBX462
00445                                                                   DTSBX462
00446  S1310-EXIT.                                                      DTSBX462
00447      EXIT.                                                        DTSBX462
00448                                                                   DTSBX462
00449  S1410-WRITE-OUTPUT-ADDR.                                         DTSBX462
00450      WRITE ADDR-OUTPUT-REC FROM WRK-XVAD-REC.                     DTSBX462
00451      IF NOT ADDR-OUTP-STATUS-OK-88                                DTSBX462
00452         DISPLAY 'S1410 BAD WRITE ON ADDR OUTPUT '                 DTSBX462
00453                  ADDR-OUTP-STATUS                                 DTSBX462
00454         PERFORM S999-ABEND THRU S999-EXIT                         DTSBX462
00455      ELSE                                                         DTSBX462
00456         ADD +1 TO WRK-ADDR-OUT-CNT                                DTSBX462
00457      END-IF.                                                      DTSBX462
00458                                                                   DTSBX462
00459  S1410-EXIT.                                                      DTSBX462
00460      EXIT.                                                        DTSBX462
00461                                                                   DTSBX462
00462  S2000-INIT-OUTPUT.                                               DTSBX462
00463      MOVE ZEROS            TO XVEM-FEIN                           DTSBX462
00464                               XVAD-FEIN.                          DTSBX462
00465                                                                   DTSBX462
00466      MOVE SPACES           TO XVEM-EMP-NO                         DTSBX462
00467                               XVEM-EMP-NAME                       DTSBX462
00468                               XVAD-STREET                         DTSBX462
00469                               XVAD-CITY                           DTSBX462
00470                               XVAD-STATE                          DTSBX462
00471                               XVAD-ZIP                            DTSBX462
00472                               XVAD-PHONE.                         DTSBX462
00473  S2000-EXIT.                                                      DTSBX462
00474      EXIT.                                                        DTSBX462
00475                                                                   DTSBX462
00476  S2100-FORMAT-PHONE-TAX.                                          DTSBX462
00477      IF (WRK-PHONE-AREA = ZERO OR SPACE OR LOW-VALUES)            DTSBX462
00478          OR (WRK-PHONE-PFX = ZERO OR SPACE OR LOW-VALUES)         DTSBX462
00479              OR (WRK-PHONE-SFX = ZERO OR SPACE OR LOW-VALUES)     DTSBX462
00480         MOVE SPACES              TO WRK-XVAD-PHONE                DTSBX462
00481         GO TO S2100-EXIT                                          DTSBX462
00482      ELSE                                                         DTSBX462
00483         MOVE '-'                 TO WRK-XVAD-PHONE-FILLER1        DTSBX462
00484                                     WRK-XVAD-PHONE-FILLER2        DTSBX462
00485      END-IF.                                                      DTSBX462
00486                                                                   DTSBX462
00487      MOVE WRK-PHONE-AREA         TO WRK-XVAD-PHONE-AREA.          DTSBX462
00488      MOVE WRK-PHONE-PFX          TO WRK-XVAD-PHONE-PFX.           DTSBX462
00489      MOVE WRK-PHONE-SFX          TO WRK-XVAD-PHONE-SFX.           DTSBX462
00490      IF WRK-PHONE-EXT > ZERO                                      DTSBX462
00491         MOVE '-'                 TO WRK-XVAD-PHONE-FILLER3        DTSBX462
00492         MOVE WRK-PHONE-EXT       TO WRK-XVAD-PHONE-EXT            DTSBX462
00493      ELSE                                                         DTSBX462
00494         MOVE ' '                 TO WRK-XVAD-PHONE-FILLER3        DTSBX462
00495      END-IF.                                                      DTSBX462
00496                                                                   DTSBX462
00497  S2100-EXIT.                                                      DTSBX462
00498      EXIT.                                                        DTSBX462
00499                                                                   DTSBX462
00500  S999-ABEND.                                                      DTSBX462
00501      CALL 'DTSBU999' USING WRK-ABEND-CD.                          DTSBX462
00502  S999-EXIT.                                                       DTSBX462
00503      EXIT.                                                        DTSBX462
