00001  IDENTIFICATION DIVISION.                                         10/27/98
00002  PROGRAM-ID.             DTSBD316.                                DTSBD316
00003  AUTHOR.                 TRICOASTAL CONSULTING LTD.                  LV003
00004  DATE-WRITTEN.           SEPTEMBER 1994.                          DTSBD316
00005  DATE-COMPILED.                                                   DTSBD316
00006                                                                      CL**2
00007 *****                                                             DTSBD316
00008 *                                                                 DTSBD316
00009 *    FUNCTION:  FILE CLERK LIST.                                  DTSBD316
00010 *                                                                 DTSBD316
00011 *                                                                 DTSBD316
00012 *    MODIFICATION LOG:                                            DTSBD316
00013 *                                                                 DTSBD316
00014 *    09/02/94  INITIAL DEVELOPMENT.                               DTSBD316
00015 *              WORK ORDER:                      PROGRAMMER: RHC   DTSBD316
00016 *                                                                 DTSBD316
00017 *    10/27/1998  REVIEWED AND MODIFIED FOR DC.                       CL**2
00018 *                REFERENCE: DC DEVELOPMENT      PROGRAMMER: EHH      CL**2
00019 *                                                                    CL**2
00020 *    MM/DD/YYYY  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX      CL**2
00021 *                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX      CL**2
00022 *                REFERENCE: XXXXXXXXXXXXXXX     PROGRAMMER: XXX      CL**2
00023 *                                                                 DTSBD316
00024 *                                                                 DTSBD316
00025 *  DESCRIPTION:                                                   DTSBD316
00026 *                                                                 DTSBD316
00027 *      THE FILE CLERK LIST IS A BIZARRE, HIGHLY COMPLEX, LIST.    DTSBD316
00028 *                                                                 DTSBD316
00029 *      IT INCOPORATES NOT ONLY EMPLOYER REGISTRATION DATA         DTSBD316
00030 *      ELEMENTS, BUT ALSO COLLECTIONS DATA ELEMENTS.  INDEED,     DTSBD316
00031 *      SOME OF THE COLLECTIONS ELEMENTS ARE UNIQUE IN THE         DTSBD316
00032 *      SYSTEM.                                                    DTSBD316
00033 *                                                                 DTSBD316
00034 *      PERFORM PROCESSING ONLY ONCE PER EMP-NO.  THAT IS,         DTSBD316
00035 *      FOR A GIVEN EMP-NO, BYPASS ALL TRANSACTIONS OTHER THAN     DTSBD316
00036 *      THE FIRST TRANSACTION.                                     DTSBD316
00037 *                                                                 DTSBD316
00038 *      PROCESSING LOGIC:                                          DTSBD316
00039 *                                                                 DTSBD316
00040 *       SCAN ALL MSOL RECORDS ASSOCIATED WITH THE EMPLOYER:       DTSBD316
00041 *                                                                 DTSBD316
00042 *        IF MSOL-ESTB-DATE = LBCM-CURR-RUN-DATE                   DTSBD316
00043 *                                                                 DTSBD316
00044 *          IF MSOL RECORD IS THE FIRST MSOL RECORD ENCOUNTERED    DTSBD316
00045 *                                                                 DTSBD316
00046 *            WRITE A R116-NEW-88 R116 RECORD                      DTSBD316
00047 *                                                                 DTSBD316
00048 *          ELSE                                                   DTSBD316
00049 *                                                                 DTSBD316
00050 *            WRITE A R116-REACT-88 R116 RECORD                    DTSBD316
00051 *                                                                 DTSBD316
00052 *        ELSE                                                     DTSBD316
00053 *                                                                 DTSBD316
00054 *        IF MSOL-INACT-REVERSE-DATE = LBCM-CURR-RUN-DATE          DTSBD316
00055 *                                                                 DTSBD316
00056 *            WRITE A R116-REACT-88 R116 RECORD.                   DTSBD316
00057 *                                                                 DTSBD316
00058 *                                                                 DTSBD316
00059 *                                                                 DTSBD316
00060 *        IF MSOL-INACT-ENTER-DATE = LBCM-CURR-RUN-DATE            DTSBD316
00061 *                                                                 DTSBD316
00062 *            WRITE A R116-INACT-88 R116 RECORD.                   DTSBD316
00063 *                                                                 DTSBD316
00064 *                                                                 DTSBD316
00065 *      NOTE THE LOGIC ON R116-NUM-DELQ-RPTS.                      DTSBD316
00066 *                                                                 DTSBD316
00067 *      IF MPRF-PURSUED-RPT-CNT IS EQUAL TO ZERO, THEN NO REPORTS  DTSBD316
00068 *      ARE PURSUED AND SCANNING THE MQTR RECORDS WOULD BE A WASTE DTSBD316
00069 *      OF TIME.                                                   DTSBD316
00070 *                                                                 DTSBD316
00071 *      EXAMINE ONLY                                               DTSBD316
00072 *      THOSE MQTR RECORDS WITH MQTR-YRQ IN THE SPAN               DTSBD316
00073 *      MSOL-FIRST-LIAB-YRQ THRU MSOL-LAST-LIAB-YRQ.  I MENTION    DTSBD316
00074 *      THIS NOT BECAUSE IT IS DIFFICULT, BUT BECAUSE IT IS        DTSBD316
00075 *      SO BIZARRE.  THE DEPARTMENT INSISTS THIS IS REALLY         DTSBD316
00076 *      WHAT THEY WANT.                                            DTSBD316
00077 *                                                                 DTSBD316
00078 *      THIS MODULE WILL BE CALLED AFTER ALL ACCOUNTING            DTSBD316
00079 *      TRANSACTIONS FOR THE EMPLOYER AND AFTER ALL "AUTO          DTSBD316
00080 *      QUARTER" EVALUATIONS FOR THE EMPLOYER.  THUS, AT THIS      DTSBD316
00081 *      POINT, MQTR-PURSUED-RPT-IND IS ACCURATE.                   DTSBD316
00082 *                                                                 DTSBD316
00083 *      IF THE MSOL RECORD REPRESENTS AN OPEN SPAN OF LIABILITY,   DTSBD316
00084 *      THEN MSOL-LAST-LIAB-YRQ WILL BE ALL NINES.  THIS SHOULD    DTSBD316
00085 *      BE CONSIDERED WHEN DESIGNING THE MQTR SCAN LOGIC.          DTSBD316
00086 *                                                                 DTSBD316
00087 *      PLEASE SEE PRINTED OUTPUTS DESCRIPTIONS AND LAYOUTS        DTSBD316
00088 *      FOR FURTHER INFOMATION.                                    DTSBD316
00089 *                                                                 DTSBD316
00090 *                                                                 DTSBD316
00091 *      MASTER FILE RECORDS READ:                                  DTSBD316
00092 *                                                                 DTSBD316
00093 *        MSOL                                                     DTSBD316
00094 *        MQTR                                                     DTSBD316
00095 *                                                                 DTSBD316
00096 *                                                                 DTSBD316
00097 *      MASTER FILE RECORDS UPDATED:                               DTSBD316
00098 *                                                                 DTSBD316
00099 *        NONE.                                                    DTSBD316
00100 *                                                                 DTSBD316
00101 *                                                                 DTSBD316
00102 *      REPORT RECORDS WRITTEN:                                    DTSBD316
00103 *                                                                 DTSBD316
00104 *        R116  NEW EMPLOYERS, REACTIVATIONS, INACTIVATIONS LIST.  DTSBD316
00105 *                                                                 DTSBD316
00106 *                                                                 DTSBD316
00107 *      MODULES CALLED:                                            DTSBD316
00108 *                                                                 DTSBD316
00109 *        DTSBU139 REFORMAT EMP NO INTO LEKTRIEVER SEQUENCE.          CL**2
00110 *        DTSBU910 MASTER FILE I/O.                                   CL**2
00111 *        DTSBU946 VARIABLE LENGTH RECORD SEQUENTIAL OUTPUT 1.        CL**2
00112 *                                                                 DTSBD316
00113 *****                                                             DTSBD316
00114      EJECT                                                        DTSBD316
00115  ENVIRONMENT DIVISION.                                            DTSBD316
00116                                                                      CL**2
00117  DATA DIVISION.                                                   DTSBD316
00118  WORKING-STORAGE SECTION.                                         DTSBD316
001185 77  PAN-VALET PICTURE X(24) VALUE '003DTSBD316  10/27/98'.       DTSBD316
00119      SKIP3                                                        DTSBD316
00120  01  WRK-AREA.                                                    DTSBD316
00121      05  WRK-ABEND-CD                PIC S9(04)  COMP  VALUE +316.DTSBD316
00122                                                                      CL**2
00123      05  WRK-MOD-NAME                PIC  X(08)  VALUE 'DTSBD316'.   CL**2
00124                                                                      CL**2
00125      05  FIRST-TIME-IND              PIC  X(01)  VALUE 'Y'.       DTSBD316
00126                                                                      CL**2
00127      05  WRK-EMP-NO                  PIC S9(07)  COMP-3.          DTSBD316
00128                                                                      CL**2
00129      05  WRK-SOL-CTR                 PIC S9(04)  COMP.            DTSBD316
00130      EJECT                                                        DTSBD316
00131  01  L910-LINK-AREA.                                              DTSBD316
00132  ++INCLUDE DTSIL910                                                  CL**2
00133      SKIP3                                                        DTSBD316
00134  01  MSKL-REC.                                                    DTSBD316
00135  ++INCLUDE DTSIMSKL                                                  CL**2
00136      SKIP3                                                        DTSBD316
00137  01  MSOL-REC.                                                    DTSBD316
00138  ++INCLUDE DTSIMSOL                                                  CL**2
00139      SKIP3                                                        DTSBD316
00140  01  MQTR-REC.                                                    DTSBD316
00141  ++INCLUDE DTSIMQTR                                                  CL**2
00142      EJECT                                                        DTSBD316
00143  01  R116-REC.                                                    DTSBD316
00144  ++INCLUDE DTSIR116                                                  CL**2
00145      EJECT                                                        DTSBD316
00146  LINKAGE SECTION.                                                 DTSBD316
00147      SKIP3                                                        DTSBD316
00148  01  LBCM-LINK-AREA.                                              DTSBD316
00149  ++INCLUDE DTSILBCM                                                  CL**2
00150      EJECT                                                        DTSBD316
00151  01  MPRF-REC.                                                    DTSBD316
00152  ++INCLUDE DTSIMPRF                                                  CL**2
00153      EJECT                                                        DTSBD316
00154  01  T001-REC.                                                    DTSBD316
00155  ++INCLUDE DTSIT001                                                  CL**2
00156      EJECT                                                        DTSBD316
00157  PROCEDURE DIVISION USING LBCM-LINK-AREA                          DTSBD316
00158                           MPRF-REC                                DTSBD316
00159                           T001-REC.                               DTSBD316
00160                                                                      CL**2
00161      IF FIRST-TIME-IND = 'Y'                                      DTSBD316
00162          PERFORM I0000-INITIATE THRU I0000-EXIT                   DTSBD316
00163          MOVE 'N' TO FIRST-TIME-IND.                              DTSBD316
00164                                                                      CL**2
00165      IF MPRF-EMP-NO = WRK-EMP-NO                                  DTSBD316
00166          GO TO PROCEDURE-EXIT.                                    DTSBD316
00167                                                                      CL**3
00168      MOVE MPRF-EMP-NO TO WRK-EMP-NO.                              DTSBD316
00169                                                                      CL**2
00170      IF NOT T001-FILE-CLERK-LIST                                  DTSBD316
00171          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBD316
00172                                                                      CL**3
00173                                                                      CL**3
00174      MOVE +0 TO WRK-SOL-CTR.                                      DTSBD316
00175                                                                      CL**2
00176                                                                      CL**3
00177      MOVE LOW-VALUE TO MSKL-KEY-AREA.                             DTSBD316
00178                                                                      CL**3
00179      MOVE WRK-EMP-NO TO MSKL-EMP-NO.                              DTSBD316
00180                                                                      CL**3
00181      SET MSKL-SOL-88 TO TRUE.                                     DTSBD316
00182                                                                      CL**3
00183      PERFORM S910-START-BROWSE THRU S910-EXIT.                    DTSBD316
00184                                                                      CL**3
00185      PERFORM UNTIL L910-NO-REC-88                                 DTSBD316
00186          PERFORM P0000-PROCESS-SOL THRU P0000-EXIT                   CL**3
00187          PERFORM S1000-READ-NEXT-SOL THRU S1000-EXIT              DTSBD316
00188      END-PERFORM.                                                 DTSBD316
00189                                                                      CL**3
00190                                                                      CL**3
00191  PROCEDURE-EXIT.                                                  DTSBD316
00192                                                                      CL**2
00193      GOBACK.                                                      DTSBD316
00194      EJECT                                                           CL**3
00195  I0000-INITIATE.                                                  DTSBD316
00196      MOVE +0 TO WRK-EMP-NO.                                       DTSBD316
00197                                                                      CL**2
00198      MOVE LBCM-TRACE-IND TO L910-TRACE-IND.                       DTSBD316
00199                                                                      CL**3
00200      MOVE WRK-MOD-NAME TO L910-MOD-NAME.                          DTSBD316
00201                                                                      CL**2
00202      MOVE LENGTH OF R116-REC TO R116-LENGTH.                         CL**3
00203  I0000-EXIT. EXIT.                                                DTSBD316
00204      EJECT                                                        DTSBD316
00205  P0000-PROCESS-SOL.                                               DTSBD316
00206      ADD +1 TO WRK-SOL-CTR.                                       DTSBD316
00207                                                                      CL**3
00208      MOVE MSKL-REC TO MSOL-REC.                                   DTSBD316
00209                                                                      CL**2
00210 *-- WHAT IF:  NEW SOL #1, INACTIVATION, AND INACTIVATION REVERSE  DTSBD316
00211 *-- ALL HAPPEN IN THE SAME DAY?  CURRENT LOGIC GIVES A R116-NEW   DTSBD316
00212 *-- AND A R116-INACT (NEITHER THREE REPORTS NOR ONE REPORT).      DTSBD316
00213 *-- ALSO: SAME DAY ACTIVATION AND INACTIVATION - TWO REPORTS      DTSBD316
00214 *--       SAME DAY INACTIVATION AND REVERSAL   - TWO REPORTS.     DTSBD316
00215                                                                      CL**2
00216      IF MSOL-ESTB-DATE = LBCM-CURR-RUN-DATE                       DTSBD316
00217          IF WRK-SOL-CTR = +1                                      DTSBD316
00218              PERFORM P1000-NEW THRU P1000-EXIT                    DTSBD316
00219          ELSE                                                     DTSBD316
00220              PERFORM P2000-REACT THRU P2000-EXIT                  DTSBD316
00221      ELSE                                                         DTSBD316
00222          IF MSOL-INACT-REVERSE-DATE = LBCM-CURR-RUN-DATE          DTSBD316
00223              PERFORM P2000-REACT THRU P2000-EXIT.                 DTSBD316
00224                                                                      CL**3
00225                                                                      CL**3
00226      IF MSOL-INACT-ENTER-DATE = LBCM-CURR-RUN-DATE                DTSBD316
00227          PERFORM P3000-INACT THRU P3000-EXIT.                     DTSBD316
00228  P0000-EXIT. EXIT.                                                DTSBD316
00229      EJECT                                                        DTSBD316
00230  P1000-NEW.                                                       DTSBD316
00231      SET R116-NEW-88 TO TRUE.                                     DTSBD316
00232                                                                      CL**3
00233      MOVE LOW-VALUE TO R116-SORT-VAR-AREA.                        DTSBD316
00234                                                                      CL**3
00235      MOVE WRK-EMP-NO TO R116-NEW-EMP-NO.                          DTSBD316
00236                                                                      CL**3
00237      MOVE MSOL-LIAB-DATE TO R116-NEW-LIAB-DATE.                   DTSBD316
00238                                                                      CL**2
00239      PERFORM S2000-DATA-AREA THRU S2000-EXIT.                     DTSBD316
00240                                                                      CL**2
00241      PERFORM S946-WRITE-R116 THRU S946-EXIT.                      DTSBD316
00242  P1000-EXIT. EXIT.                                                DTSBD316
00243      SKIP3                                                        DTSBD316
00244  P2000-REACT.                                                     DTSBD316
00245      SET R116-REACT-88 TO TRUE.                                   DTSBD316
00246                                                                      CL**3
00247      MOVE LOW-VALUE TO R116-SORT-VAR-AREA.                        DTSBD316
00248                                                                      CL**3
00249      MOVE WRK-EMP-NO TO R116-REACT-EMP-NO.                        DTSBD316
00250                                                                      CL**3
00251      MOVE MSOL-LIAB-DATE TO R116-REACT-LIAB-DATE.                 DTSBD316
00252                                                                      CL**2
00253      PERFORM S2000-DATA-AREA THRU S2000-EXIT.                     DTSBD316
00254                                                                      CL**2
00255      PERFORM S946-WRITE-R116 THRU S946-EXIT.                      DTSBD316
00256  P2000-EXIT. EXIT.                                                DTSBD316
00257      SKIP3                                                        DTSBD316
00258  P3000-INACT.                                                     DTSBD316
00259      SET R116-INACT-88 TO TRUE                                    DTSBD316
00260                                                                      CL**3
00261      MOVE LOW-VALUE TO R116-SORT-VAR-AREA.                        DTSBD316
00262                                                                      CL**3
00263      MOVE WRK-EMP-NO TO R116-INACT-EMP-NO.                           CL**3
00264                                                                      CL**3
00265      MOVE MSOL-LIAB-DATE TO R116-INACT-LIAB-DATE                  DTSBD316
00266                                                                      CL**2
00267      PERFORM S2000-DATA-AREA THRU S2000-EXIT.                     DTSBD316
00268                                                                      CL**2
00269      PERFORM S946-WRITE-R116 THRU S946-EXIT.                      DTSBD316
00270  P3000-EXIT. EXIT.                                                DTSBD316
00271      EJECT                                                        DTSBD316
00272  S910-READ.                                                       DTSBD316
00273      SET L910-READ-88 TO TRUE.                                    DTSBD316
00274      GO TO S910-MSTR-IO.                                          DTSBD316
00275                                                                      CL**2
00276  S910-START-BROWSE.                                               DTSBD316
00277      SET L910-START-BROWSE-88 TO TRUE.                            DTSBD316
00278      GO TO S910-MSTR-IO.                                          DTSBD316
00279                                                                      CL**2
00280  S910-READ-NEXT.                                                  DTSBD316
00281      SET L910-READ-NEXT-88 TO TRUE.                               DTSBD316
00282      GO TO S910-MSTR-IO.                                          DTSBD316
00283                                                                      CL**2
00284 *S910-COUNT.                                                      DTSBD316
00285 *****SET L910-COUNT-88 TO TRUE.                                      CL**3
00286 *****GO TO S910-MSTR-IO.                                             CL**3
00287                                                                      CL**3
00288 *S910-WRITE.                                                      DTSBD316
00289 *****SET L910-WRITE-88 TO TRUE.                                      CL**3
00290 *****SET LBCM-EMP-UPDATE-YES-88 TO TRUE.                             CL**3
00291 *****GO TO S910-MSTR-IO.                                             CL**3
00292                                                                      CL**3
00293 *S910-REWRITE.                                                    DTSBD316
00294 *****SET L910-REWRITE-88 TO TRUE.                                    CL**3
00295 *****SET LBCM-EMP-UPDATE-YES-88 TO TRUE.                             CL**3
00296 *****GO TO S910-MSTR-IO.                                             CL**3
00297                                                                      CL**3
00298 *S910-DELETE.                                                     DTSBD316
00299 *****SET L910-DELETE-88 TO TRUE.                                     CL**3
00300 *****SET LBCM-EMP-UPDATE-YES-88 TO TRUE.                             CL**3
00301 *****GO TO S910-MSTR-IO.                                             CL**3
00302                                                                      CL**2
00303  S910-MSTR-IO.                                                    DTSBD316
00304      CALL 'DTSBU910' USING L910-LINK-AREA                            CL**2
00305                            MSKL-REC.                              DTSBD316
00306  S910-EXIT. EXIT.                                                 DTSBD316
00307      SKIP3                                                        DTSBD316
00308  S946-WRITE-R116.                                                 DTSBD316
00309      CALL 'DTSBU946' USING R116-REC.                                 CL**2
00310  S946-EXIT. EXIT.                                                 DTSBD316
00311      SKIP3                                                        DTSBD316
00312  S999-ABEND.                                                      DTSBD316
00313      CALL 'DTSBU999' USING WRK-ABEND-CD.                             CL**2
00314  S999-EXIT. EXIT.                                                 DTSBD316
00315      EJECT                                                        DTSBD316
00316  S1000-READ-NEXT-SOL.                                             DTSBD316
00317      IF MSKL-KEY-AREA  NOT =  MSOL-KEY-AREA                       DTSBD316
00318          MOVE MSOL-KEY-AREA TO MSKL-KEY-AREA                      DTSBD316
00319          PERFORM S910-READ THRU S910-EXIT                         DTSBD316
00320          IF L910-NO-REC-88                                        DTSBD316
00321              PERFORM S999-ABEND THRU S999-EXIT.                   DTSBD316
00322                                                                      CL**2
00323      PERFORM S910-READ-NEXT THRU S910-EXIT.                       DTSBD316
00324  S1000-EXIT. EXIT.                                                DTSBD316
00325      EJECT                                                        DTSBD316
00326  S2000-DATA-AREA.                                                 DTSBD316
00327      MOVE MPRF-PRIMARY-NAME TO R116-PRIMARY-NAME.                    CL**3
00328                                                                      CL**3
00329      MOVE MSOL-INACT-DATE TO R116-INACT-DATE.                     DTSBD316
00330                                                                      CL**3
00331      MOVE MPRF-EMP-CLASS TO R116-EMP-CLASS.                       DTSBD316
00332                                                                      CL**3
00333                                                                      CL**3
00334      MOVE +0 TO R116-NUM-DELQ-RPTS.                               DTSBD316
00335                                                                      CL**3
00336      IF MPRF-PURSUED-RPT-CNT = +0                                 DTSBD316
00337          GO TO S2000-EXIT.                                        DTSBD316
00338                                                                      CL**2
00339      MOVE LOW-VALUE TO MQTR-KEY-AREA.                             DTSBD316
00340                                                                      CL**3
00341      MOVE WRK-EMP-NO TO MQTR-EMP-NO.                              DTSBD316
00342                                                                      CL**3
00343      SET MQTR-QTR-88 TO TRUE.                                     DTSBD316
00344                                                                      CL**3
00345      MOVE MSOL-FIRST-LIAB-YRQ TO MQTR-YRQ.                        DTSBD316
00346                                                                      CL**3
00347      MOVE MQTR-KEY-AREA TO MSKL-KEY-AREA.                         DTSBD316
00348                                                                      CL**3
00349      PERFORM S910-START-BROWSE THRU S910-EXIT.                    DTSBD316
00350                                                                      CL**3
00351      PERFORM S2100-MQTR-RAID THRU S2100-EXIT                      DTSBD316
00352              UNTIL L910-NO-REC-88.                                DTSBD316
00353  S2000-EXIT. EXIT.                                                DTSBD316
00354      EJECT                                                        DTSBD316
00355  S2100-MQTR-RAID.                                                 DTSBD316
00356      MOVE MSKL-REC TO MQTR-REC.                                   DTSBD316
00357                                                                      CL**3
00358      IF MQTR-YRQ > MSOL-LAST-LIAB-YRQ                             DTSBD316
00359          SET L910-NO-REC-88 TO TRUE                               DTSBD316
00360          GO TO S2100-EXIT.                                        DTSBD316
00361                                                                      CL**2
00362      IF MQTR-RPT-IS-PURSUED-88                                    DTSBD316
00363          ADD +1 TO R116-NUM-DELQ-RPTS.                            DTSBD316
00364                                                                      CL**2
00365      PERFORM S910-READ-NEXT THRU S910-EXIT.                       DTSBD316
00366  S2100-EXIT. EXIT.                                                DTSBD316
