00001  IDENTIFICATION DIVISION.                                         06/13/05
00002  PROGRAM-ID.             DTSBX463.                                DTSBX463
00003  AUTHOR.                 NGC.                                        LV001
00004  DATE-WRITTEN.           MARCH 2005.                              DTSBX463
00005  DATE-COMPILED.                                                   DTSBX463
00006      SKIP3                                                        DTSBX463
00007 *****                                                             DTSBX463
00008 *                                                                 DTSBX463
00009 *    FUNCTION:  ELIMINATE DUPLICATE ADDRESSES FROM VOS OUTPUT     DTSBX463
00010 *               FILE. WHEN DUPLICATES ARE FOUND, USE THE FOLLOWINGDTSBX463
00011 *               ORDER OF PRECEDENCE:                              DTSBX463
00012 *                  DOES ADDRESS                                   DTSBX463
00013 *                  NEW HIRE ADDRESS                               DTSBX463
00014 *                  OTR ADDRESS                                    DTSBX463
00015 *                                                                 DTSBX463
00016 *  MODIFICATION LOG:                                              DTSBX463
00017 *                                                                 DTSBX463
00018 *    01/11/2005  INITIAL DEVELOPMENT.                             DTSBX463
00019 *                REFERENCE:                      PROGRAMMER: GD   DTSBX463
00020 *                                                                 DTSBX463
00021 *****                                                             DTSBX463
00022      SKIP3                                                        DTSBX463
00023  ENVIRONMENT DIVISION.                                            DTSBX463
00024      SKIP2                                                        DTSBX463
00025  INPUT-OUTPUT SECTION.                                            DTSBX463
00026  FILE-CONTROL.                                                    DTSBX463
00027      SELECT ADDR-INPUT-FILE                                       DTSBX463
00028         ASSIGN TO ADRINP                                          DTSBX463
00029         FILE STATUS IS ADDR-INP-STATUS.                           DTSBX463
00030                                                                   DTSBX463
00031      SELECT ADDR-OUTPUT-FILE                                      DTSBX463
00032         ASSIGN TO ADDROUTP                                        DTSBX463
00033         FILE STATUS IS ADDR-OUTP-STATUS.                          DTSBX463
00034                                                                   DTSBX463
00035  DATA DIVISION.                                                   DTSBX463
00036      SKIP3                                                        DTSBX463
00037  FILE SECTION.                                                    DTSBX463
00038  FD  ADDR-INPUT-FILE                                              DTSBX463
00039      LABEL RECORDS ARE STANDARD.                                  DTSBX463
00040  01  ADDR-INPUT-REC                  PIC X(128).                  DTSBX463
00041                                                                   DTSBX463
00042  FD  ADDR-OUTPUT-FILE                                             DTSBX463
00043      LABEL RECORDS ARE STANDARD.                                  DTSBX463
00044  01  ADDR-OUTPUT-REC                 PIC X(128).                  DTSBX463
00045                                                                   DTSBX463
00046      EJECT                                                        DTSBX463
00047  WORKING-STORAGE SECTION.                                         DTSBX463
000475 77  PAN-VALET PICTURE X(24) VALUE '001DTSBX463  06/13/05'.       DTSBX463
00048      SKIP3                                                        DTSBX463
00049  01  WRK-AREA.                                                    DTSBX463
00050      05  WRK-ABEND-CD                PIC S9(04)  COMP  VALUE +462.DTSBX463
00051                                                                   DTSBX463
00052      05  WRK-MOD-NAME                PIC  X(08)  VALUE 'DTSBX462'.DTSBX463
00053                                                                   DTSBX463
00054      05  WRK-INPUT-ADDR-CNT          PIC S9(07)  COMP-3 VALUE 0.  DTSBX463
00055      05  WRK-OUTPUT-ADDR-CNT         PIC S9(07)  COMP-3 VALUE 0.  DTSBX463
00056                                                                   DTSBX463
00057      05  ADDR-INP-STATUS               PIC  X(02).                DTSBX463
00058          88  ADDR-INP-STATUS-OK-88   VALUE '00', '97'.            DTSBX463
00059          88  ADDR-INP-STATUS-EOF-88  VALUE '10'.                  DTSBX463
00060                                                                   DTSBX463
00061      05  ADDR-OUTP-STATUS              PIC  X(02).                DTSBX463
00062          88  ADDR-OUTP-STATUS-OK-88   VALUE '00', '97'.           DTSBX463
00063                                                                   DTSBX463
00064      05  WRK-ERROR-IND               PIC  X(01).                  DTSBX463
00065          88 WRK-ERROR-YES-88        VALUE 'Y'.                    DTSBX463
00066          88 WRK-ERROR-NO-88         VALUE 'N'.                    DTSBX463
00067                                                                   DTSBX463
00068      05  WRK-STREET                   PIC  X(60)  VALUE SPACES.   DTSBX463
00069      05  WRK-CITY                     PIC  X(25)  VALUE SPACES.   DTSBX463
00070                                                                   DTSBX463
00071      05  WRK-FEIN                        PIC  9(09)  VALUE 0.     DTSBX463
00072                                                                   DTSBX463
00073  01  WRK-XVAD-REC.                                                DTSBX463
00074  ++INCLUDE DTSIXVAD                                               DTSBX463
00075                                                                   DTSBX463
00076  PROCEDURE DIVISION.                                              DTSBX463
00077                                                                   DTSBX463
00078  DTSBX463-MAIN.                                                   DTSBX463
00079      PERFORM I0000-INITIATE THRU I0000-EXIT.                      DTSBX463
00080      IF WRK-ERROR-YES-88                                          DTSBX463
00081         GO TO DTSBX463-MAIN-EXIT.                                 DTSBX463
00082                                                                   DTSBX463
00083      PERFORM P0000-PROCESS THRU P0000-EXIT.                       DTSBX463
00084                                                                   DTSBX463
00085      PERFORM T0000-TERMINATE THRU T0000-EXIT.                     DTSBX463
00086                                                                   DTSBX463
00087  DTSBX463-MAIN-EXIT.                                              DTSBX463
00088      GOBACK.                                                      DTSBX463
00089      EJECT                                                        DTSBX463
00090  I0000-INITIATE.                                                  DTSBX463
00091      SET WRK-ERROR-NO-88 TO TRUE.                                 DTSBX463
00092                                                                   DTSBX463
00093      PERFORM I1000-OPEN-FILES          THRU I1000-EXIT.           DTSBX463
00094                                                                   DTSBX463
00095  I0000-EXIT.                                                      DTSBX463
00096      EXIT.                                                        DTSBX463
00097  I1000-OPEN-FILES.                                                DTSBX463
00098      PERFORM S1300-OPEN-ADDR-INPUT   THRU S1300-EXIT.             DTSBX463
00099      IF WRK-ERROR-YES-88                                          DTSBX463
00100         GO TO I1000-EXIT                                          DTSBX463
00101      END-IF.                                                      DTSBX463
00102                                                                   DTSBX463
00103      PERFORM S1400-OPEN-ADDR-OUTPUT   THRU S1400-EXIT.            DTSBX463
00104      IF WRK-ERROR-YES-88                                          DTSBX463
00105         SET WRK-ERROR-YES-88 TO TRUE                              DTSBX463
00106         GO TO I1000-EXIT                                          DTSBX463
00107      END-IF.                                                      DTSBX463
00108                                                                   DTSBX463
00109  I1000-EXIT.                                                      DTSBX463
00110      EXIT.                                                        DTSBX463
00111                                                                   DTSBX463
00112  P0000-PROCESS.                                                   DTSBX463
00113      PERFORM S1310-READ-ADDR-INPUT    THRU S1310-EXIT.            DTSBX463
00114      IF NOT ADDR-INP-STATUS-OK-88                                 DTSBX463
00115         DISPLAY 'BAD FIRST READ OF INPUT FILE '                   DTSBX463
00116             ADDR-INP-STATUS                                       DTSBX463
00117         GO TO P0000-EXIT                                          DTSBX463
00118      ELSE                                                         DTSBX463
00119         MOVE XVAD-FEIN                   TO WRK-FEIN              DTSBX463
00120         MOVE XVAD-STREET                 TO WRK-STREET            DTSBX463
00121         MOVE XVAD-CITY                   TO WRK-CITY              DTSBX463
00122         PERFORM S1410-WRITE-OUTPUT-ADDR  THRU S1410-EXIT          DTSBX463
00123      END-IF.                                                      DTSBX463
00124                                                                   DTSBX463
00125      PERFORM P1000-ELIM-DUPS             THRU P1000-EXIT          DTSBX463
00126        UNTIL ADDR-INP-STATUS-EOF-88.                              DTSBX463
00127                                                                   DTSBX463
00128  P0000-EXIT.                                                      DTSBX463
00129      EXIT.                                                        DTSBX463
00130                                                                   DTSBX463
00131  P1000-ELIM-DUPS.                                                 DTSBX463
00132      PERFORM S1310-READ-ADDR-INPUT    THRU S1310-EXIT.            DTSBX463
00133 *&                                                                DTSBX463
00134      IF XVAD-FEIN = 010206260                                     DTSBX463
00135         DISPLAY SPACE                                             DTSBX463
00136         DISPLAY 'P0000 ' XVAD-STREET '  ' XVAD-CITY               DTSBX463
00137         DISPLAY '      ' WRK-STREET '  ' WRK-CITY                 DTSBX463
00138      END-IF.                                                      DTSBX463
00139 *&                                                                DTSBX463
00140                                                                   DTSBX463
00141      IF XVAD-FEIN = WRK-FEIN                                      DTSBX463
00142         IF XVAD-STREET = WRK-STREET                               DTSBX463
00143         AND XVAD-CITY = WRK-CITY                                  DTSBX463
00144            NEXT SENTENCE                                          DTSBX463
00145         ELSE                                                      DTSBX463
00146            PERFORM S1410-WRITE-OUTPUT-ADDR  THRU S1410-EXIT       DTSBX463
00147            MOVE XVAD-STREET    TO WRK-STREET                      DTSBX463
00148            MOVE XVAD-CITY      TO WRK-CITY                        DTSBX463
00149         END-IF                                                    DTSBX463
00150      ELSE                                                         DTSBX463
00151         MOVE XVAD-FEIN      TO WRK-FEIN                           DTSBX463
00152         MOVE XVAD-STREET    TO WRK-STREET                         DTSBX463
00153         MOVE XVAD-CITY      TO WRK-CITY                           DTSBX463
00154         PERFORM S1410-WRITE-OUTPUT-ADDR  THRU S1410-EXIT          DTSBX463
00155      END-IF.                                                      DTSBX463
00156                                                                   DTSBX463
00157  P1000-EXIT.                                                      DTSBX463
00158      EXIT.                                                        DTSBX463
00159                                                                   DTSBX463
00160  T0000-TERMINATE.                                                 DTSBX463
00161                                                                   DTSBX463
00162      DISPLAY ' '.                                                 DTSBX463
00163                                                                   DTSBX463
00164      DISPLAY '*** DTSBX463 TERMINATION STATISTICS ***'.           DTSBX463
00165                                                                   DTSBX463
00166      DISPLAY ' '.                                                 DTSBX463
00167                                                                   DTSBX463
00168      DISPLAY 'NUMBER OF ADDR INPUT RECORDS READ       : '         DTSBX463
00169              WRK-INPUT-ADDR-CNT.                                  DTSBX463
00170                                                                   DTSBX463
00171      DISPLAY 'NUMBER OF ADDR OUTPUT RECORDS WRITTEN   : '         DTSBX463
00172              WRK-OUTPUT-ADDR-CNT.                                 DTSBX463
00173                                                                   DTSBX463
00174      PERFORM S1320-CLOSE-ADDR-INPUT        THRU S1320-EXIT.       DTSBX463
00175      PERFORM S1420-CLOSE-ADDR-OUTPUT-FILE  THRU S1420-EXIT.       DTSBX463
00176                                                                   DTSBX463
00177                                                                   DTSBX463
00178  T0000-EXIT.                                                      DTSBX463
00179      EXIT.                                                        DTSBX463
00180      EJECT                                                        DTSBX463
00181                                                                   DTSBX463
00182  S1300-OPEN-ADDR-INPUT.                                           DTSBX463
00183      OPEN INPUT ADDR-INPUT-FILE.                                  DTSBX463
00184      IF NOT ADDR-INP-STATUS-OK-88                                 DTSBX463
00185         DISPLAY 'CANNOT OPEN ADDR INPUT ' ADDR-INP-STATUS         DTSBX463
00186         SET WRK-ERROR-YES-88 TO TRUE                              DTSBX463
00187      END-IF.                                                      DTSBX463
00188                                                                   DTSBX463
00189  S1300-EXIT.                                                      DTSBX463
00190      EXIT.                                                        DTSBX463
00191                                                                   DTSBX463
00192  S1310-READ-ADDR-INPUT.                                           DTSBX463
00193      READ ADDR-INPUT-FILE INTO WRK-XVAD-REC.                      DTSBX463
00194      IF ADDR-INP-STATUS-OK-88                                     DTSBX463
00195         ADD +1 TO WRK-INPUT-ADDR-CNT                              DTSBX463
00196      ELSE                                                         DTSBX463
00197         IF NOT ADDR-INP-STATUS-EOF-88                             DTSBX463
00198            DISPLAY 'S1310 BAD READ ON ADDR INPUT '                DTSBX463
00199               ADDR-INP-STATUS                                     DTSBX463
00200            SET ADDR-INP-STATUS-EOF-88 TO TRUE                     DTSBX463
00201         END-IF                                                    DTSBX463
00202      END-IF.                                                      DTSBX463
00203                                                                   DTSBX463
00204  S1310-EXIT.                                                      DTSBX463
00205      EXIT.                                                        DTSBX463
00206                                                                   DTSBX463
00207  S1320-CLOSE-ADDR-INPUT.                                          DTSBX463
00208      CLOSE ADDR-INPUT-FILE.                                       DTSBX463
00209                                                                   DTSBX463
00210  S1320-EXIT.                                                      DTSBX463
00211      EXIT.                                                        DTSBX463
00212                                                                   DTSBX463
00213  S1400-OPEN-ADDR-OUTPUT.                                          DTSBX463
00214      OPEN OUTPUT ADDR-OUTPUT-FILE.                                DTSBX463
00215      IF NOT ADDR-OUTP-STATUS-OK-88                                DTSBX463
00216         DISPLAY 'CANNOT OPEN ADDR OUTPUT FILE '                   DTSBX463
00217             ADDR-OUTP-STATUS                                      DTSBX463
00218         SET WRK-ERROR-YES-88 TO TRUE                              DTSBX463
00219      END-IF.                                                      DTSBX463
00220                                                                   DTSBX463
00221  S1400-EXIT.                                                      DTSBX463
00222      EXIT.                                                        DTSBX463
00223                                                                   DTSBX463
00224  S1410-WRITE-OUTPUT-ADDR.                                         DTSBX463
00225 *&                                                                DTSBX463
00226      IF XVAD-FEIN = 010206260                                     DTSBX463
00227         DISPLAY 'S1410 ' XVAD-FEIN '  ' XVAD-STREET               DTSBX463
00228             '  ' XVAD-CITY                                        DTSBX463
00229      END-IF.                                                      DTSBX463
00230 *&                                                                DTSBX463
00231      WRITE ADDR-OUTPUT-REC FROM WRK-XVAD-REC.                     DTSBX463
00232      IF NOT ADDR-OUTP-STATUS-OK-88                                DTSBX463
00233         DISPLAY 'S1410 BAD WRITE ON ADDR OUTPUT '                 DTSBX463
00234                  ADDR-OUTP-STATUS                                 DTSBX463
00235         SET ADDR-INP-STATUS-EOF-88  TO TRUE                       DTSBX463
00236      ELSE                                                         DTSBX463
00237         ADD +1 TO WRK-OUTPUT-ADDR-CNT                             DTSBX463
00238      END-IF.                                                      DTSBX463
00239                                                                   DTSBX463
00240  S1410-EXIT.                                                      DTSBX463
00241      EXIT.                                                        DTSBX463
00242                                                                   DTSBX463
00243  S1420-CLOSE-ADDR-OUTPUT-FILE.                                    DTSBX463
00244      CLOSE ADDR-OUTPUT-FILE.                                      DTSBX463
00245                                                                   DTSBX463
00246  S1420-EXIT.                                                      DTSBX463
00247      EXIT.                                                        DTSBX463
00248                                                                   DTSBX463
00249                                                                   DTSBX463
00250  S999-ABEND.                                                      DTSBX463
00251      CALL 'DTSBU999' USING WRK-ABEND-CD.                          DTSBX463
00252  S999-EXIT.                                                       DTSBX463
00253      EXIT.                                                        DTSBX463
