00001  IDENTIFICATION DIVISION.                                         07/30/10
00002  PROGRAM-ID.             DTSBX122.                                DTSBX122
00003  AUTHOR.                 NORTHROP GRUMMAN                            LV001
00004  DATE-WRITTEN.           JULY 2010.                               DTSBX122
00005 *DATE-MODIFIED.                                                   DTSBX122
00006  DATE-COMPILED.                                                   DTSBX122
00007                                                                   DTSBX122
00008 *****                                                             DTSBX122
00009 *                                                                 DTSBX122
00010 *    FUNCTION:  EXTRACT R122 STATUS DETERMINATION RECORDS         DTSBX122
00011 *               FOR DOWNLOAD TO SQL SERVER DATABASE               DTSBX122
00012 *                                                                 DTSBX122
00013 *    MODIFICATION HISTORY:                                        DTSBX122
00014 *                                                                 DTSBX122
00015 * 07-07-2010 INITIAL DEVELOPMENT.                                 DTSBX122
00016 *          REFERENCE RFP #****            AUTHOR OF CHANGE - GD   DTSBX122
00017 *                                                                 DTSBX122
00018 *                                                                 DTSBX122
00019 * MM-DD-YY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  DTSBX122
00020 *          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  DTSBX122
00021 *          REFERENCE RFP #****            AUTHOR OF CHANGE - XXX  DTSBX122
00022 *                                                                 DTSBX122
00023 *    DESCRIPTION:                                                 DTSBX122
00024 *                                                                 DTSBX122
00025 *        DTSBX122 READS THE CURRENT GENERATION OF THE             DTSBX122
00026 *        SRTDAY07.RPT FILE PRODUCED DURING WEEK-END PROCESSING    DTSBX122
00027 *        (DTSPDAY7), AND WRITES OUTPUT RECORDS FOR EXPORT         DTSBX122
00028 *        TO THE SERVER DATABASE.                                  DTSBX122
00029 *                                                                 DTSBX122
00030 *                                                                 DTSBX122
00031 *                                                                 DTSBX122
00032 *                                                                 DTSBX122
00033 *    RECORDS READ:                                                DTSBX122
00034 *                                                                 DTSBX122
00035 *        EXTRACT R122 RECORDS FROM THE SORT WEEKLY REPORT FILE    DTSBX122
00036 *                                                                 DTSBX122
00037 *    PRINTED OUTPUTS:                                             DTSBX122
00038 *                                                                 DTSBX122
00039 *       NONE.                                                     DTSBX122
00040 *                                                                 DTSBX122
00041 *    RECORDS WRITTEN:                                             DTSBX122
00042 *                                                                 DTSBX122
00043 *        A COMMA SEPARATED BATCH CONTROL SUMMARY INFORMATION.     DTSBX122
00044 *                                                                 DTSBX122
00045 *    MODULES CALLED:                                              DTSBX122
00046 *                                                                 DTSBX122
00047 *        DTSBU001 DATE EDIT/CONVERSION MODULE                     DTSBX122
00048 *        DTSBU005 DATE EDIT/CONVERSION MODULE                     DTSBX122
00049 *        DTSBU941 VARIABLE LENGTH RECORD READ                     DTSBX122
00050 *                                                                 DTSBX122
00051 *****                                                             DTSBX122
00052                                                                   DTSBX122
00053  ENVIRONMENT DIVISION.                                            DTSBX122
00054                                                                   DTSBX122
00055  CONFIGURATION SECTION.                                           DTSBX122
00056                                                                   DTSBX122
00057  INPUT-OUTPUT SECTION.                                            DTSBX122
00058                                                                   DTSBX122
00059  FILE-CONTROL.                                                    DTSBX122
00060      SELECT REGISTRATION-FILE      ASSIGN TO DTSFREG              DTSBX122
00061             FILE STATUS IS REGISTRATION-STATUS.                   DTSBX122
00062                                                                   DTSBX122
00063  DATA DIVISION.                                                   DTSBX122
00064                                                                   DTSBX122
00065  FILE SECTION.                                                    DTSBX122
00066                                                                   DTSBX122
00067  FD  REGISTRATION-FILE                                            DTSBX122
00068      RECORDING MODE IS F                                          DTSBX122
00069      BLOCK CONTAINS 0 RECORDS                                     DTSBX122
00070      LABEL RECORDS ARE OMITTED.                                   DTSBX122
00071                                                                   DTSBX122
00072  01  REGISTRATION-REC        PIC X(94).                           DTSBX122
00073                                                                   DTSBX122
00074  WORKING-STORAGE SECTION.                                         DTSBX122
000745 77  PAN-VALET PICTURE X(24) VALUE '001DTSBX122  07/30/10'.       DTSBX122
00075  01  WRK-AREA.                                                    DTSBX122
00076      05  FILE-STATUS                  PIC 9(02) VALUE ZEROS.      DTSBX122
00077      05  WRK-MOD-NAME                 PIC X(08) VALUE 'DTSBX122'. DTSBX122
00078                                                                   DTSBX122
00079      05  WRK-ERROR-IND                PIC  X(01) VALUE 'N'.       DTSBX122
00080          88  WRK-ERROR-YES-88          VALUE 'Y'.                 DTSBX122
00081          88  WRK-ERROR-NO-88           VALUE 'N'.                 DTSBX122
00082                                                                   DTSBX122
00083      05  REGISTRATION-STATUS          PIC  X(02).                 DTSBX122
00084          88  REGISTRATION-STATUS-OK-88  VALUE '00'.               DTSBX122
00085                                                                   DTSBX122
00086      05  WRK-ABEND-CD                 PIC S9(04) COMP  VALUE +122.DTSBX122
00087      05  WRK-READ-CNT                 PIC S9(07) COMP-3 VALUE +0. DTSBX122
00088      05  WRK-REGISTRATION-CNT         PIC S9(07) COMP-3 VALUE +0. DTSBX122
00089                                                                   DTSBX122
00090                                                                   DTSBX122
00091  01  L001-LINK-AREA.                                              DTSBX122
00092  ++INCLUDE DTSIL001                                               DTSBX122
00093                                                                   DTSBX122
00094  01  L005-LINK-AREA.                                              DTSBX122
00095  ++INCLUDE DTSIL005                                               DTSBX122
00096                                                                   DTSBX122
00097  01  WRK-X122-REC.                                                DTSBX122
00098  ++INCLUDE DTSIX122                                               DTSBX122
00099                                                                   DTSBX122
00100  01  L941-LINK-AREA.                                              DTSBX122
00101  ++INCLUDE DTSIL941                                               DTSBX122
00102                                                                   DTSBX122
00103  01  RSK3-REC.                                                    DTSBX122
00104  ++INCLUDE DTSIRSK3                                               DTSBX122
00105                                                                   DTSBX122
00106  01  R122-REC.                                                    DTSBX122
00107  ++INCLUDE DTSIR122                                               DTSBX122
00108                                                                   DTSBX122
00109  PROCEDURE DIVISION.                                              DTSBX122
00110      PERFORM I0000-INITIATE     THRU I0000-EXIT.                  DTSBX122
00111      IF WRK-ERROR-NO-88                                           DTSBX122
00112         PERFORM P0000-PROCESS      THRU P0000-EXIT                DTSBX122
00113         PERFORM T0000-TERMINATE    THRU T0000-EXIT                DTSBX122
00114      END-IF.                                                      DTSBX122
00115                                                                   DTSBX122
00116      GOBACK.                                                      DTSBX122
00117                                                                   DTSBX122
00118  I0000-INITIATE.                                                  DTSBX122
00119      PERFORM I2000-OPEN-FILES     THRU I2000-EXIT.                DTSBX122
00120                                                                   DTSBX122
00121  I0000-EXIT.                                                      DTSBX122
00122      EXIT.                                                        DTSBX122
00123                                                                   DTSBX122
00124  I2000-OPEN-FILES.                                                DTSBX122
00125      OPEN OUTPUT REGISTRATION-FILE.                               DTSBX122
00126      IF REGISTRATION-STATUS-OK-88                                 DTSBX122
00127         NEXT SENTENCE                                             DTSBX122
00128      ELSE                                                         DTSBX122
00129         SET WRK-ERROR-YES-88   TO TRUE                            DTSBX122
00130         DISPLAY 'CANNOT OPEN REGISTRATION FILE '                  DTSBX122
00131              REGISTRATION-STATUS                                  DTSBX122
00132         GO TO I2000-EXIT                                          DTSBX122
00133      END-IF.                                                      DTSBX122
00134                                                                   DTSBX122
00135      PERFORM S941-OPEN        THRU S941-EXIT.                     DTSBX122
00136                                                                   DTSBX122
00137  I2000-EXIT.                                                      DTSBX122
00138      EXIT.                                                        DTSBX122
00139                                                                   DTSBX122
00140  P0000-PROCESS.                                                   DTSBX122
00141      PERFORM P1000-FROM-RPTS     THRU P1000-EXIT.                 DTSBX122
00142                                                                   DTSBX122
00143      IF WRK-REGISTRATION-CNT = ZERO                               DTSBX122
00144         PERFORM P2000-WRITE-X122-DUMMY   THRU P2000-EXIT          DTSBX122
00145      END-IF.                                                      DTSBX122
00146                                                                   DTSBX122
00147  P0000-EXIT.                                                      DTSBX122
00148      EXIT.                                                        DTSBX122
00149                                                                   DTSBX122
00150  P1000-FROM-RPTS.                                                 DTSBX122
00151      PERFORM S941-READ-NEXT            THRU S941-EXIT.            DTSBX122
00152                                                                   DTSBX122
00153      PERFORM UNTIL L941-NO-REC-88                                 DTSBX122
00154         IF RSK3-REC-TYPE = '122'                                  DTSBX122
00155             ADD +1                     TO WRK-READ-CNT            DTSBX122
00156             MOVE RSK3-REC              TO R122-REC                DTSBX122
00157             PERFORM P1100-PROCESS-R122 THRU P1100-EXIT            DTSBX122
00158         END-IF                                                    DTSBX122
00159         PERFORM S941-READ-NEXT         THRU S941-EXIT             DTSBX122
00160      END-PERFORM.                                                 DTSBX122
00161                                                                   DTSBX122
00162  P1000-EXIT.                                                      DTSBX122
00163      EXIT.                                                        DTSBX122
00164                                                                   DTSBX122
00165  P1100-PROCESS-R122.                                              DTSBX122
00166      IF R122-LIAB-ENTERED-NEW-88                                  DTSBX122
00167      OR R122-LIAB-ENTERED-SUCC-88                                 DTSBX122
00168      OR R122-INACT-ENTERED-88                                     DTSBX122
00169      OR R122-INACT-REVERSED-88                                    DTSBX122
00170         NEXT SENTENCE                                             DTSBX122
00171      ELSE                                                         DTSBX122
00172         GO TO P1100-EXIT                                          DTSBX122
00173      END-IF.                                                      DTSBX122
00174                                                                   DTSBX122
00175      MOVE R122-EMP-NO                   TO X122-EMP-NO.           DTSBX122
00176                                                                   DTSBX122
00177      MOVE R122-PERIOD-START-DATE        TO L001-FED-8-DATE-9.     DTSBX122
00178      PERFORM S001-FROM-FED-8            THRU S001-EXIT.           DTSBX122
00179      MOVE L001-SLASH-8-DATE             TO X122-PERIOD-START-DT.  DTSBX122
00180      MOVE R122-PERIOD-END-DATE          TO L001-FED-8-DATE-9.     DTSBX122
00181      PERFORM S001-FROM-FED-8            THRU S001-EXIT.           DTSBX122
00182      MOVE L001-SLASH-8-DATE             TO X122-PERIOD-END-DT.    DTSBX122
00183                                                                   DTSBX122
00184      MOVE R122-CATEGORY                 TO X122-CATEGORY.         DTSBX122
00185      MOVE R122-OP-ID                    TO X122-OPID.             DTSBX122
00186                                                                   DTSBX122
00187      MOVE R122-LIAB-ESTAB-DATE          TO L001-FED-8-DATE-9.     DTSBX122
00188      PERFORM S001-FROM-FED-8            THRU S001-EXIT.           DTSBX122
00189      IF L001-INVALID-DATE                                         DTSBX122
00190         MOVE SPACES                     TO X122-LIAB-ESTB-DATE    DTSBX122
00191      ELSE                                                         DTSBX122
00192         MOVE L001-SLASH-8-DATE          TO X122-LIAB-ESTB-DATE    DTSBX122
00193      END-IF.                                                      DTSBX122
00194      MOVE R122-LIAB-ENTRY-DATE          TO L001-FED-8-DATE-9.     DTSBX122
00195      PERFORM S001-FROM-FED-8            THRU S001-EXIT.           DTSBX122
00196      IF L001-INVALID-DATE                                         DTSBX122
00197         MOVE SPACES                     TO X122-LIAB-ENTRY-DATE   DTSBX122
00198      ELSE                                                         DTSBX122
00199         MOVE L001-SLASH-8-DATE          TO X122-LIAB-ENTRY-DATE   DTSBX122
00200      END-IF.                                                      DTSBX122
00201                                                                   DTSBX122
00202      MOVE SPACES                        TO X122-INACTIVE-DATE     DTSBX122
00203                                            X122-INAC-ENTRY-DATE   DTSBX122
00204                                            X122-REVERSE-DATE.     DTSBX122
00205                                                                   DTSBX122
00206      IF R122-INACT-ENTERED-88                                     DTSBX122
00207         MOVE R122-INAC-E-DATE           TO L001-FED-8-DATE-9      DTSBX122
00208         PERFORM S001-FROM-FED-8         THRU S001-EXIT            DTSBX122
00209         IF L001-INVALID-DATE                                      DTSBX122
00210            MOVE SPACES                  TO X122-INACTIVE-DATE     DTSBX122
00211         ELSE                                                      DTSBX122
00212            MOVE L001-SLASH-8-DATE       TO X122-INACTIVE-DATE     DTSBX122
00213         END-IF                                                    DTSBX122
00214         MOVE R122-INAC-E-INACT-DATE     TO L001-FED-8-DATE-9      DTSBX122
00215         PERFORM S001-FROM-FED-8         THRU S001-EXIT            DTSBX122
00216         IF L001-INVALID-DATE                                      DTSBX122
00217            MOVE SPACES                  TO X122-INAC-ENTRY-DATE   DTSBX122
00218         ELSE                                                      DTSBX122
00219            MOVE L001-SLASH-8-DATE       TO X122-INAC-ENTRY-DATE   DTSBX122
00220         END-IF                                                    DTSBX122
00221      ELSE                                                         DTSBX122
00222         MOVE SPACES                     TO X122-INACTIVE-DATE     DTSBX122
00223      END-IF.                                                      DTSBX122
00224                                                                   DTSBX122
00225                                                                   DTSBX122
00226      IF R122-INACT-REVERSED-88                                    DTSBX122
00227         MOVE SPACES                     TO X122-INACTIVE-DATE     DTSBX122
00228         MOVE SPACES                     TO X122-INAC-ENTRY-DATE   DTSBX122
00229         MOVE R122-INAC-R-DATE           TO L001-FED-8-DATE-9      DTSBX122
00230         PERFORM S001-FROM-FED-8         THRU S001-EXIT            DTSBX122
00231         IF L001-INVALID-DATE                                      DTSBX122
00232            MOVE SPACES                  TO X122-REVERSE-DATE      DTSBX122
00233         ELSE                                                      DTSBX122
00234            MOVE L001-SLASH-8-DATE       TO X122-REVERSE-DATE      DTSBX122
00235         END-IF                                                    DTSBX122
00236      ELSE                                                         DTSBX122
00237         MOVE SPACES                     TO X122-REVERSE-DATE      DTSBX122
00238      END-IF.                                                      DTSBX122
00239                                                                   DTSBX122
00240      WRITE REGISTRATION-REC             FROM  WRK-X122-REC.       DTSBX122
00241      ADD +1                             TO WRK-REGISTRATION-CNT.  DTSBX122
00242                                                                   DTSBX122
00243  P1100-EXIT.                                                      DTSBX122
00244      EXIT.                                                        DTSBX122
00245                                                                   DTSBX122
00246  P2000-WRITE-X122-DUMMY.                                          DTSBX122
00247      MOVE ZERO                      TO X122-EMP-NO.               DTSBX122
00248                                                                   DTSBX122
00249      MOVE SPACES                    TO X122-PERIOD-END-DT         DTSBX122
00250                                        X122-CATEGORY              DTSBX122
00251                                        X122-OPID                  DTSBX122
00252                                        X122-LIAB-ENTRY-DATE       DTSBX122
00253                                        X122-INACTIVE-DATE         DTSBX122
00254                                        X122-INAC-ENTRY-DATE       DTSBX122
00255                                        X122-REVERSE-DATE.         DTSBX122
00256                                                                   DTSBX122
00257                                                                   DTSBX122
00258      WRITE REGISTRATION-REC         FROM  WRK-X122-REC.           DTSBX122
00259      ADD +1                         TO WRK-REGISTRATION-CNT.      DTSBX122
00260                                                                   DTSBX122
00261      DISPLAY 'DTSBX122 - NO REGISTRATIONS FOUND'.                 DTSBX122
00262  P2000-EXIT.                                                      DTSBX122
00263      EXIT.                                                        DTSBX122
00264                                                                   DTSBX122
00265                                                                   DTSBX122
00266  S001-FROM-FED-8.                                                 DTSBX122
00267      SET L001-FROM-FED-8 TO TRUE.                                 DTSBX122
00268      GO TO S001-DATE.                                             DTSBX122
00269                                                                   DTSBX122
00270  S001-DATE.                                                       DTSBX122
00271      CALL 'DTSBU001' USING L001-LINK-AREA.                        DTSBX122
00272  S001-EXIT.                                                       DTSBX122
00273      EXIT.                                                        DTSBX122
00274                                                                   DTSBX122
00275  S005-DATE.                                                       DTSBX122
00276      CALL 'DTSBU005' USING L005-LINK-AREA.                        DTSBX122
00277  S005-EXIT.                                                       DTSBX122
00278      EXIT.                                                        DTSBX122
00279                                                                   DTSBX122
00280  S941-OPEN.                                                       DTSBX122
00281      SET L941-OPEN-READ-88 TO TRUE.                               DTSBX122
00282      GO TO S941-I.                                                DTSBX122
00283                                                                   DTSBX122
00284  S941-READ-NEXT.                                                  DTSBX122
00285      SET L941-READ-NEXT-88 TO TRUE.                               DTSBX122
00286      GO TO S941-I.                                                DTSBX122
00287                                                                   DTSBX122
00288  S941-CLOSE.                                                      DTSBX122
00289      SET L941-CLOSE-88 TO TRUE.                                   DTSBX122
00290      GO TO S941-I.                                                DTSBX122
00291                                                                   DTSBX122
00292  S941-I.                                                          DTSBX122
00293      CALL 'DTSBU941' USING L941-LINK-AREA,                        DTSBX122
00294                            RSK3-REC.                              DTSBX122
00295  S941-EXIT.                                                       DTSBX122
00296      EXIT.                                                        DTSBX122
00297                                                                   DTSBX122
00298  S999-ABEND.                                                      DTSBX122
00299      CALL 'DTSBU999' USING WRK-ABEND-CD.                          DTSBX122
00300      SKIP2                                                        DTSBX122
00301  S999-EXIT.                                                       DTSBX122
00302      EXIT.                                                        DTSBX122
00303                                                                   DTSBX122
00304  T0000-TERMINATE.                                                 DTSBX122
00305                                                                   DTSBX122
00306      DISPLAY '      '.                                            DTSBX122
00307                                                                   DTSBX122
00308      DISPLAY 'TOTAL REGISTRATION RECS READ    '                   DTSBX122
00309               WRK-READ-CNT.                                       DTSBX122
00310                                                                   DTSBX122
00311      DISPLAY 'TOTAL REGISTRATION RECS WRITTEN '                   DTSBX122
00312               WRK-REGISTRATION-CNT.                               DTSBX122
00313                                                                   DTSBX122
00314      PERFORM S941-CLOSE THRU S941-EXIT.                           DTSBX122
00315      CLOSE REGISTRATION-FILE.                                     DTSBX122
00316                                                                   DTSBX122
00317  T0000-EXIT.                                                      DTSBX122
00318      EXIT.                                                        DTSBX122
00319                                                                   DTSBX122
