00001  IDENTIFICATION DIVISION.                                         10/25/02
00002  PROGRAM-ID.             DTX00001.                                DTX00001
00003  AUTHOR.                 TRW, INC.                                   LV058
00004  DATE-WRITTEN.           OCTOBER 2003.                               CL**1
00005  DATE-COMPILED.                                                      CL**1
00006                                                                      CL**1
00007 *****                                                                CL**1
00008 *    THIS PROGRAM REFORMATS THE FEIN DATA FILE RECEIVED FROM OTR.    CL**2
00009 *                                                                    CL**1
00010 *****                                                                CL**1
00011                                                                      CL**2
00012  ENVIRONMENT DIVISION.                                               CL**1
00013  CONFIGURATION SECTION.                                              CL*47
00014  SPECIAL-NAMES.  C01 IS TOP-OF-PAGE.                                 CL*50
00015                                                                      CL**1
00016  INPUT-OUTPUT SECTION.                                               CL**1
00017                                                                      CL**1
00018  FILE-CONTROL.                                                       CL**1
00019      SELECT OTR-FEIN-INFILE  ASSIGN TO OTRINFLE.                     CL**2
00020      SELECT OTR-FEIN-OUTFILE ASSIGN TO OTROUTFL.                     CL**2
00021      SELECT SORT-FILE        ASSIGN TO SORTWORK.                     CL*51
00022      SELECT PRINT-FILE       ASSIGN TO RPTX0001.                     CL*51
00023                                                                      CL**1
00024  DATA DIVISION.                                                      CL**1
00025                                                                      CL**1
00026  FILE SECTION.                                                       CL**1
00027                                                                      CL**1
00028  SD  SORT-FILE.                                                      CL*29
00029  01  SORT-RECORD.                                                    CL*30
00030      05  SORT-KEY                   PIC X(09).                       CL*30
00031      05  FILLER                     PIC X(182).                      CL*30
00032                                                                      CL*29
00033  FD  PRINT-FILE                                                      CL*46
00034      RECORDING MODE IS F.                                            CL*46
00035  01  PRINT-RECORD.                                                   CL*46
00036      05  FILLER                     PIC X(01).                       CL*46
00037      05  PRT-LITERAL                PIC X(11).                       CL*52
00038      05  PRT-KEY                    PIC X(10).                       CL*52
00039      05  PRT-KEY-CD                 PIC X(04).                       CL*52
00040      05  PRT-NAME                   PIC X(34).                       CL*58
00041      05  PRT-ADDR1                  PIC X(40).                       CL*52
00042                                                                      CL*46
00043  FD  OTR-FEIN-INFILE                                                 CL*29
00044      LABEL RECORDS ARE STANDARD                                      CL*29
00045      BLOCK CONTAINS 0 RECORDS                                        CL*29
00046      RECORDING MODE IS F.                                            CL*29
00047  01  OTR-IN-RECORD.                                                  CL*29
00048      05  OTR-IN-EMPLR-NAME          PIC X(70).                       CL*11
00049      05  FILLER                     PIC X(49).                       CL*15
00050      05  OTR-IN-TYPE-TAX            PIC X(10).                       CL*15
00051      05  FILLER                     PIC X(32).                       CL*15
00052      05  OTR-IN-FEIN-SSN            PIC X(09).                       CL**2
00053      05  FILLER                     PIC X(03).                       CL**2
00054      05  OTR-IN-FEIN-SSN-CD         PIC X(04).                       CL**3
00055      05  OTR-IN-STREET-LINE1        PIC X(60).                       CL**3
00056      05  OTR-IN-CITY                PIC X(20).                       CL**3
00057      05  OTR-IN-STATE               PIC X(02).                       CL**3
00058      05  OTR-IN-ZIP                 PIC X(10).                       CL**3
00059      05  FILLER                     PIC X(403).                      CL*13
00060      05  OTR-IN-PHONE               PIC X(10).                       CL**4
00061      05  FILLER                     PIC X(05).                       CL*11
00062                                                                      CL**2
00063  FD  OTR-FEIN-OUTFILE                                                CL**2
00064      LABEL RECORDS ARE STANDARD                                      CL**2
00065      BLOCK CONTAINS 0 RECORDS                                        CL**2
00066      RECORDING MODE IS F.                                            CL**2
00067  01  FEIN-OUT-RECORD                PIC X(191).                      CL*14
00068                                                                      CL**2
00069  WORKING-STORAGE SECTION.                                            CL**1
000695 77  PAN-VALET PICTURE X(24) VALUE '058DTX00001  10/25/02'.          CL**1
00070                                                                      CL**1
00071  01  WRK-AREA.                                                       CL**7
00072      05  WRK-HDR-LINE.                                               CL*54
00073          10  FILLER                 PIC X(30) VALUE SPACES.          CL*54
00074          10  FILLER                 PIC X(30) VALUE                  CL*54
00075              'DUPLICATE FEINS FROM OTR'.                             CL*54
00076      05  SPACER                     PIC X(01) VALUE SPACES.          CL*54
00077      05  WRK-LAST-FEIN-SSN          PIC X(09) VALUE SPACES.          CL**7
00078      05  WRK-LAST-CD                PIC X(03) VALUE SPACES.          CL*37
00079      05  WRK-LAST-NAME              PIC X(30) VALUE SPACES.          CL*36
00080      05  WRK-LAST-STREET            PIC X(40) VALUE SPACES.          CL*36
00081      05  WRK-COUNTERS.                                               CL**5
00082          10  WRK-LINE-CNT           PIC 9(02) VALUE 60.              CL*54
00083          10  RECS-IN-CNT            PIC 9(07) VALUE ZEROS.           CL*47
00084          10  RECS-IN-BYPASS-CNT     PIC 9(07) VALUE ZEROS.           CL*15
00085          10  RECS-OUT-CNT           PIC 9(07) VALUE ZEROS.           CL**5
00086          10  RECS-OUT-SSN-CNT       PIC 9(07) VALUE ZEROS.           CL*18
00087          10  RECS-OUT-JNT-CNT       PIC 9(07) VALUE ZEROS.           CL*26
00088          10  RECS-OUT-TEMP-CNT      PIC 9(07) VALUE ZEROS.           CL*20
00089          10  RECS-OUT-FEIN-CNT      PIC 9(07) VALUE ZEROS.           CL*20
00090          10  RECS-OUT-BTN-CNT       PIC 9(07) VALUE ZEROS.           CL*18
00091          10  RECS-DUP-CNT           PIC 9(07) VALUE ZEROS.           CL*37
00092          10  RECS-WITH-CNT          PIC 9(07) VALUE ZEROS.           CL*39
00093          10  RECS-PERS-CNT          PIC 9(07) VALUE ZEROS.           CL*39
00094          10  RECS-UNCP-CNT          PIC 9(07) VALUE ZEROS.           CL*39
00095          10  RECS-SALE-CNT          PIC 9(07) VALUE ZEROS.           CL*39
00096          10  RECS-CORP-CNT          PIC 9(07) VALUE ZEROS.           CL*39
00097                                                                      CL*18
00098      05  OTR-OUT-RECORD.                                             CL*30
00099          10  OTR-OUT-FEIN-SSN           PIC X(09).                   CL*14
00100          10  FILLER                     PIC X(01) VALUE ','.         CL*14
00101          10  OTR-OUT-FEIN-SSN-CD        PIC X(03).                   CL*14
00102          10  FILLER                     PIC X(01) VALUE ','.         CL*14
00103          10  OTR-OUT-EMPLR-NAME         PIC X(70).                   CL*14
00104          10  FILLER                     PIC X(01) VALUE ','.         CL*14
00105          10  OTR-OUT-STREET-LINE1       PIC X(60).                   CL*14
00106          10  FILLER                     PIC X(01) VALUE ','.         CL*14
00107          10  OTR-OUT-CITY               PIC X(20).                   CL*14
00108          10  FILLER                     PIC X(01) VALUE ','.         CL*14
00109          10  OTR-OUT-STATE              PIC X(02).                   CL*14
00110          10  FILLER                     PIC X(01) VALUE ','.         CL*14
00111          10  OTR-OUT-ZIP                PIC X(10).                   CL*14
00112          10  FILLER                     PIC X(01) VALUE ','.         CL*14
00113          10  OTR-OUT-PHONE              PIC X(10).                   CL*14
00114                                                                      CL**5
00115  PROCEDURE DIVISION.                                                 CL**5
00116                                                                      CL**1
00117      PERFORM I1000-INITIATE    THRU I1000-EXIT.                      CL*29
00118      PERFORM P1000-PROCESS     THRU P1000-EXIT.                      CL*29
00119      PERFORM P2000-CHECK-DUPS  THRU P2000-EXIT.                      CL*29
00120      PERFORM T1000-TERMINATE   THRU T1000-EXIT.                      CL*29
00121                                                                      CL**1
00122      GOBACK.                                                         CL**1
00123                                                                      CL**5
00124  I1000-INITIATE.                                                     CL**1
00125                                                                      CL**1
00126      OPEN INPUT  OTR-FEIN-INFILE                                     CL**5
00127           OUTPUT OTR-FEIN-OUTFILE.                                   CL**5
00128                                                                      CL**1
00129  I1000-EXIT.                                                         CL**1
00130      EXIT.                                                           CL**1
00131                                                                      CL**1
00132  P1000-PROCESS.                                                      CL**1
00133      READ OTR-FEIN-INFILE                                            CL**7
00134           AT END GO TO P1000-EXIT.                                   CL**5
00135                                                                      CL**5
00136      ADD 1 TO RECS-IN-CNT.                                           CL**7
00137                                                                      CL**5
00138      IF OTR-IN-TYPE-TAX (1:4) EQUAL 'PERS'                           CL*39
00139         ADD 1 TO RECS-PERS-CNT                                       CL*39
00140      ELSE                                                            CL*39
00141      IF OTR-IN-TYPE-TAX (1:4) EQUAL 'UNCP'                           CL*39
00142         ADD 1 TO RECS-UNCP-CNT                                       CL*39
00143      ELSE                                                            CL*39
00144      IF OTR-IN-TYPE-TAX (1:4) EQUAL 'SALE'                           CL*39
00145         ADD 1 TO RECS-SALE-CNT                                       CL*39
00146      ELSE                                                            CL*39
00147      IF OTR-IN-TYPE-TAX (1:4) EQUAL 'CORP'                           CL*39
00148         ADD 1 TO RECS-CORP-CNT.                                      CL*44
00149                                                                      CL*28
00150      IF OTR-IN-TYPE-TAX (1:4) EQUAL 'WITH'                           CL*39
00151         ADD 1 TO RECS-WITH-CNT                                       CL*39
00152      ELSE                                                            CL*39
00153         ADD 1 TO RECS-IN-BYPASS-CNT                                  CL*44
00154         GO TO P1000-PROCESS.                                         CL*39
00155                                                                      CL*39
00156      IF OTR-IN-FEIN-SSN-CD EQUAL 'TEMP'                              CL*21
00157         ADD 1 TO RECS-OUT-TEMP-CNT                                   CL*20
00158      ELSE                                                            CL*18
00159      IF OTR-IN-FEIN-SSN-CD EQUAL 'SSN'                               CL*20
00160         ADD 1 TO RECS-OUT-SSN-CNT                                    CL*20
00161      ELSE                                                            CL*20
00162      IF OTR-IN-FEIN-SSN-CD EQUAL 'BTN'                               CL*19
00163         ADD 1 TO RECS-OUT-BTN-CNT                                    CL*18
00164      ELSE                                                            CL*18
00165      IF OTR-IN-FEIN-SSN-CD EQUAL 'EIN'                               CL*19
00166         ADD 1 TO RECS-OUT-FEIN-CNT                                   CL*23
00167      ELSE                                                            CL*23
00168      IF OTR-IN-FEIN-SSN-CD EQUAL 'JNT'                               CL*27
00169         ADD 1 TO RECS-OUT-JNT-CNT                                    CL*39
00170      ELSE                                                            CL*25
00171         DISPLAY OTR-IN-FEIN-SSN-CD.                                  CL*24
00172                                                                      CL*18
00173      MOVE OTR-IN-FEIN-SSN     TO OTR-OUT-FEIN-SSN.                   CL*39
00174      MOVE OTR-IN-FEIN-SSN-CD  TO OTR-OUT-FEIN-SSN-CD.                CL**5
00175      MOVE OTR-IN-EMPLR-NAME   TO OTR-OUT-EMPLR-NAME.                 CL*39
00176      MOVE OTR-IN-STREET-LINE1 TO OTR-OUT-STREET-LINE1.               CL**5
00177      MOVE OTR-IN-CITY         TO OTR-OUT-CITY.                       CL**5
00178      MOVE OTR-IN-STATE        TO OTR-OUT-STATE.                      CL**5
00179      MOVE OTR-IN-ZIP          TO OTR-OUT-ZIP.                        CL**5
00180      MOVE OTR-IN-PHONE        TO OTR-OUT-PHONE.                      CL**5
00181                                                                      CL**6
00182      ADD 1 TO RECS-OUT-CNT.                                          CL**6
00183      WRITE FEIN-OUT-RECORD FROM OTR-OUT-RECORD.                      CL*30
00184      GO TO P1000-PROCESS.                                            CL**6
00185                                                                      CL**1
00186  P1000-EXIT.                                                         CL**1
00187      EXIT.                                                           CL**1
00188                                                                      CL**1
00189  P2000-CHECK-DUPS.                                                   CL*30
00190      MOVE SPACES TO WRK-LAST-FEIN-SSN.                               CL*30
00191      CLOSE OTR-FEIN-OUTFILE.                                         CL*47
00192                                                                      CL*47
00193      SORT SORT-FILE ASCENDING KEY SORT-KEY                           CL*32
00194           USING  OTR-FEIN-OUTFILE                                    CL*30
00195           GIVING OTR-FEIN-OUTFILE.                                   CL*30
00196                                                                      CL*47
00197      OPEN INPUT  OTR-FEIN-OUTFILE.                                   CL*47
00198                                                                      CL*47
00199      OPEN OUTPUT PRINT-FILE.                                         CL*47
00200                                                                      CL*47
00201  P2000-CD-1.                                                         CL*30
00202      READ OTR-FEIN-OUTFILE INTO OTR-OUT-RECORD                       CL*32
00203        AT END                                                        CL*30
00204           GO TO P2000-EXIT.                                          CL*30
00205                                                                      CL*35
00206      IF OTR-OUT-FEIN-SSN EQUAL WRK-LAST-FEIN-SSN                     CL*30
00207         ADD 1 TO RECS-DUP-CNT                                        CL*37
00208         IF WRK-LAST-NAME GREATER SPACES                              CL*33
00209            PERFORM P2001-PG-BREAK THRU P2001-EXIT                    CL*57
00210            WRITE PRINT-RECORD FROM SPACER AFTER 1                    CL*57
00211            MOVE 'DUP KEY --'      TO PRT-LITERAL                     CL*56
00212            MOVE WRK-LAST-FEIN-SSN TO PRT-KEY                         CL*56
00213            MOVE WRK-LAST-CD       TO PRT-KEY-CD                      CL*56
00214            MOVE WRK-LAST-NAME     TO PRT-NAME                        CL*56
00215            MOVE WRK-LAST-STREET   TO PRT-ADDR1                       CL*56
00216            MOVE SPACES            TO WRK-LAST-NAME                   CL*56
00217            WRITE PRINT-RECORD AFTER 1                                CL*53
00218                                                                      CL*53
00219            MOVE SPACES                      TO PRT-LITERAL           CL*53
00220            MOVE OTR-OUT-FEIN-SSN            TO PRT-KEY               CL*53
00221            MOVE OTR-OUT-FEIN-SSN-CD         TO PRT-KEY-CD            CL*53
00222            MOVE OTR-OUT-EMPLR-NAME (1:30)   TO PRT-NAME              CL*53
00223            MOVE OTR-OUT-STREET-LINE1 (1:40) TO PRT-ADDR1             CL*53
00224            WRITE PRINT-RECORD AFTER 1                                CL*53
00225            ADD 3 TO WRK-LINE-CNT                                     CL*57
00226         ELSE                                                         CL*33
00227            MOVE OTR-OUT-FEIN-SSN            TO PRT-KEY               CL*53
00228            MOVE OTR-OUT-FEIN-SSN-CD         TO PRT-KEY-CD            CL*53
00229            MOVE OTR-OUT-EMPLR-NAME (1:30)   TO PRT-NAME              CL*53
00230            MOVE OTR-OUT-STREET-LINE1 (1:40) TO PRT-ADDR1             CL*53
00231            WRITE PRINT-RECORD AFTER 1                                CL*53
00232            ADD 1 TO WRK-LINE-CNT                                     CL*49
00233      ELSE                                                            CL*30
00234         MOVE OTR-OUT-FEIN-SSN     TO WRK-LAST-FEIN-SSN               CL*35
00235         MOVE OTR-OUT-FEIN-SSN-CD  TO WRK-LAST-CD                     CL*33
00236         MOVE OTR-OUT-EMPLR-NAME   TO WRK-LAST-NAME                   CL*33
00237         MOVE OTR-OUT-STREET-LINE1 TO WRK-LAST-STREET.                CL*35
00238      GO TO P2000-CD-1.                                               CL*30
00239  P2000-EXIT.                                                         CL*31
00240      EXIT.                                                           CL*30
00241                                                                      CL*30
00242  P2001-PG-BREAK.                                                     CL*54
00243      IF WRK-LINE-CNT GREATER 55                                      CL*54
00244         MOVE ZEROS TO WRK-LINE-CNT                                   CL*54
00245         WRITE PRINT-RECORD FROM WRK-HDR-LINE AFTER TOP-OF-PAGE.      CL*54
00246  P2001-EXIT.                                                         CL*54
00247      EXIT.                                                           CL*54
00248                                                                      CL*54
00249  T1000-TERMINATE.                                                    CL**1
00250      IF WRK-LINE-CNT GREATER 42                                      CL*49
00251         MOVE 60 TO WRK-LINE-CNT                                      CL*55
00252         PERFORM P2001-PG-BREAK THRU P2001-EXIT.                      CL*55
00253                                                                      CL*49
00254      DISPLAY ' ***********************************************'.     CL*46
00255      DISPLAY ' OTR RECORDS READ = ' RECS-IN-CNT.                     CL*46
00256      DISPLAY ' TAX WITHHELD   = ' RECS-WITH-CNT.                     CL*46
00257      DISPLAY ' OTR BYPASSED   = ' RECS-IN-BYPASS-CNT.                CL*46
00258      DISPLAY '    SALES&USE = ' RECS-SALE-CNT.                       CL*46
00259      DISPLAY '    PERS PROP = ' RECS-PERS-CNT.                       CL*46
00260      DISPLAY '    CORP FRAN = ' RECS-CORP-CNT.                       CL*46
00261      DISPLAY '    UNCP FRAN = ' RECS-UNCP-CNT.                       CL*46
00262      DISPLAY ' RECORDS WRITTEN  = ' RECS-OUT-CNT.                    CL*46
00263      DISPLAY '        FEIN    = ' RECS-OUT-FEIN-CNT.                 CL*46
00264      DISPLAY '        SSN     = ' RECS-OUT-SSN-CNT.                  CL*46
00265      DISPLAY '        JNT     = ' RECS-OUT-JNT-CNT.                  CL*46
00266      DISPLAY '        BTN     = ' RECS-OUT-BTN-CNT.                  CL*46
00267      DISPLAY '        TEMP    = ' RECS-OUT-TEMP-CNT.                 CL*46
00268      DISPLAY '  DUPLICATES  = ' RECS-DUP-CNT.                        CL*46
00269      DISPLAY ' ***********************************************'.     CL*46
00270                                                                      CL*46
00271      CLOSE OTR-FEIN-INFILE, OTR-FEIN-OUTFILE, PRINT-FILE.            CL*47
00272                                                                      CL**1
00273  T1000-EXIT.                                                         CL**1
00274      EXIT.                                                           CL**1
