00001  IDENTIFICATION DIVISION.                                         01/29/02
00002  PROGRAM-ID.             DTSCU004                                 DTSCU004
00003  AUTHOR.                 TRICOASTAL CONSULTING LTD.                  LV008
00004  DATE-WRITTEN            DECEMBER 1991.                           DTSCU004
00005  DATE-COMPILED.                                                   DTSCU004
00006      SKIP3                                                        DTSCU004
00007 *****                                                             DTSCU004
00008 *                                                                 DTSCU004
00009 *    FUNCTION:   QUARTER EDIT/CONVERSION MODULE                   DTSCU004
00010 *                                                                 DTSCU004
00011 *                                                                 DTSCU004
00012 *    MODIFICATION LOG:                                            DTSCU004
00013 *                                                                 DTSCU004
00014 *    07/31/98    INITIAL DEVELOPMENT.  MODIFIED FROM MACCU004.    DTSCU004
00015 *                WORK ORDER:                 PROGRAMMER: ZL1.     DTSCU004
00016 *                                                                 DTSCU004
00017 *    09/29/1998  INSERTED L004-SLASH-5-QTR RELATED CODE.          DTSCU004
00018 *                REFERENCE: DC DEVELOPMENT   PROGRAMMER: EHH      DTSCU004
00019 *                                                                 DTSCU004
00020 *    MM/DD/YYYY  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX      DTSCU004
00021 *                REFERENCE: XXXXXXXXXXXXXXX  PROGRAMMER: XXX      DTSCU004
00022 *                                                                 DTSCU004
00023 *                                                                 DTSCU004
00024 *    DESCRIPTION:                                                 DTSCU004
00025 *                                                                 DTSCU004
00026 *        THE FUNCTION OF DTSCU004 IS TO VALIDATE QUARTER DATES    DTSCU004
00027 *        AND CONVERT AMONG VARIOUS QUARTER REPRESENTATIONS.       DTSCU004
00028 *                                                                 DTSCU004
00029 *        EVERY CALL RETURNS THE FOLLOWING.                        DTSCU004
00030 *                                                                 DTSCU004
00031 *        1.  QUARTER DATE - YYYY Q                                DTSCU004
00032 *        2.  QUARTER DATE - YY Q                                  DTSCU004
00033 *        3.  NINES COMPLEMENT OF QUARTER DATE 1                   DTSCU004
00034 *        4.  ABSOLUTE QUARTERS SINCE 1930                         DTSCU004
00035 *        5.  QUARTER START DATE - YYYYMMDD                        DTSCU004
00036 *        6.  QUARTER END DATE - YYYYMMDD                          DTSCU004
00037 *        7.  DEFAULT REPORT DUE DATE - YYYYMMDD                   DTSCU004
00038 *                                                                 DTSCU004
00039 *****                                                             DTSCU004
00040  SKIP3                                                            DTSCU004
00041  ENVIRONMENT DIVISION.                                            DTSCU004
00042  DATA DIVISION.                                                   DTSCU004
00043  SKIP3                                                            DTSCU004
00044  WORKING-STORAGE SECTION.                                         DTSCU004
000445 77  PAN-VALET PICTURE X(24) VALUE '008DTSCU004  01/29/02'.       DTSCU004
00045  01  WRK-AREA.                                                    DTSCU004
00046      05  WS-ABEND-CODE                       PIC  X(04)           DTSCU004
00047                                                  VALUE 'U004'.    DTSCU004
00048      05  WS-QTR-YEAR.                                             DTSCU004
00049          10  WS-QTR-CENTURY                  PIC  9(02).          DTSCU004
00050          10  WS-QTR-YR                       PIC  9(02).          DTSCU004
00051      05  WS-STARTING-DATE-X.                                      DTSCU004
00052          10  WS-STARTING-YR                  PIC  9(04).          DTSCU004
00053          10  WS-STARTING-MO                  PIC  9(02).          DTSCU004
00054          10  WS-STARTING-DA                  PIC  9(02)           DTSCU004
00055                                                 VALUE 01.         DTSCU004
00056      05  WS-STARTING-DATE-9 REDEFINES WS-STARTING-DATE-X          DTSCU004
00057                                              PIC  9(08).          DTSCU004
00058      05  WS-END-DATE-X.                                           DTSCU004
00059          10  WS-END-YR                       PIC  9(04).          DTSCU004
00060          10  WS-END-MO                       PIC  9(02).          DTSCU004
00061          10  WS-END-DA                       PIC  9(02).          DTSCU004
00062      05  WS-END-DATE-9 REDEFINES WS-END-DATE-X                    DTSCU004
00063                                              PIC  9(08).          DTSCU004
00064      05  WS-DUE-DATE-X.                                           DTSCU004
00065          10  WS-DUE-YR                       PIC  9(04).          DTSCU004
00066          10  WS-DUE-MO                       PIC  9(02).          DTSCU004
00067          10  WS-DUE-DA                       PIC  9(02).          DTSCU004
00068      05  WS-DUE-DATE-9 REDEFINES WS-DUE-DATE-X                    DTSCU004
00069                                              PIC  9(08).          DTSCU004
00070      05  WS-ANN-DUE-DATE-X.                                       DTSCU004
00071          10  WS-ANN-DUE-YR                   PIC  9(04).          DTSCU004
00072          10  WS-ANN-DUE-MO                   PIC  9(02).          DTSCU004
00073          10  WS-ANN-DUE-DA                   PIC  9(02).          DTSCU004
00074      05  WS-ANN-DUE-DATE-9 REDEFINES WS-ANN-DUE-DATE-X            DTSCU004
00075                                          PIC  9(08).              DTSCU004
00076  LINKAGE SECTION.                                                 DTSCU004
00077  01  DFHCOMMAREA.                                                 DTSCU004
00078  ++INCLUDE DTSIL004                                               DTSCU004
00079  PROCEDURE DIVISION.                                              DTSCU004
00080      SKIP2                                                        DTSCU004
00081      MOVE '0' TO L004-RETURN-CODE.                                DTSCU004
00082      IF L004-FROM-5                                               DTSCU004
00083          PERFORM P0100-FROM-5 THRU                                DTSCU004
00084                  P0100-FROM-5-EXIT                                DTSCU004
00085      ELSE                                                         DTSCU004
00086      IF L004-FROM-3                                               DTSCU004
00087         PERFORM P0200-FROM-3 THRU                                 DTSCU004
00088                 P0200-FROM-3-EXIT                                 DTSCU004
00089      ELSE                                                         DTSCU004
00090      IF L004-FROM-ABS                                             DTSCU004
00091         PERFORM P0300-FROM-ABS THRU                               DTSCU004
00092                 P0300-FROM-ABS-EXIT                               DTSCU004
00093      ELSE                                                         DTSCU004
00094      IF L004-FROM-DATE                                            DTSCU004
00095         PERFORM P0400-FROM-DATE THRU                              DTSCU004
00096                 P0400-FROM-DATE-EXIT                              DTSCU004
00097      ELSE                                                         DTSCU004
00098      IF L004-FROM-NINES-COMPLEMENT                                DTSCU004
00099         PERFORM P0500-FROM-COMP THRU                              DTSCU004
00100                 P0500-FROM-COMP-EXIT                              DTSCU004
00101      ELSE                                                         DTSCU004
00102        EXEC CICS ABEND ABCODE (WS-ABEND-CODE) END-EXEC            DTSCU004
00103        STOP RUN.                                                  DTSCU004
00104  INIT0199-GO-BACK.                                                DTSCU004
00105      EXEC CICS                                                    DTSCU004
00106          RETURN                                                   DTSCU004
00107      END-EXEC.                                                    DTSCU004
00108      SKIP3                                                        DTSCU004
00109  P0100-FROM-5.                                                    DTSCU004
00110      IF L004-QTR-5-X NOT NUMERIC OR                               DTSCU004
00111         L004-QTR-5-Q < 1  OR                                      DTSCU004
00112         L004-QTR-5-Q > 4                                          DTSCU004
00113         PERFORM P0600-INVALID-ENTRY THRU                          DTSCU004
00114                 P0600-INVALID-ENTRY-EXIT                          DTSCU004
00115         GO TO P0100-FROM-5-EXIT.                                  DTSCU004
00116      PERFORM P0700-CHECK-YR THRU                                  DTSCU004
00117              P0700-CHECK-YR-EXIT.                                 DTSCU004
00118      MOVE L004-QTR-5-YR TO WS-QTR-YEAR.                           DTSCU004
00119      MOVE WS-QTR-YR     TO L004-QTR-3-YR.                         DTSCU004
00120      MOVE L004-QTR-5-Q  TO L004-QTR-3-Q.                          DTSCU004
00121      PERFORM P2000-CAL-COMP  THRU                                 DTSCU004
00122              P2000-CAL-COMP-EXIT.                                 DTSCU004
00123      PERFORM P3000-CAL-ABS THRU                                   DTSCU004
00124              P3000-CAL-ABS-EXIT.                                  DTSCU004
00125      PERFORM P4000-SLASH-QTR THRU                                 DTSCU004
00126              P4000-SLASH-QTR-EXIT.                                DTSCU004
00127      PERFORM P5000-START-END-DATES THRU                           DTSCU004
00128              P5000-START-END-DATES-EXIT.                          DTSCU004
00129      MOVE WS-STARTING-DATE-9 TO L004-QTR-START-DATE.              DTSCU004
00130      MOVE WS-END-DATE-9      TO L004-QTR-END-DATE.                DTSCU004
00131      MOVE WS-DUE-DATE-9      TO L004-QTR-DEFAULT-DUE-DATE.        DTSCU004
00132      MOVE WS-ANN-DUE-DATE-9      TO L004-ANN-DEFAULT-DUE-DATE.    DTSCU004
00133  P0100-FROM-5-EXIT.  EXIT.                                        DTSCU004
00134      SKIP3                                                        DTSCU004
00135  P0200-FROM-3.                                                    DTSCU004
00136      IF L004-QTR-3-X NOT NUMERIC                                  DTSCU004
00137          PERFORM P0600-INVALID-ENTRY THRU                         DTSCU004
00138                  P0600-INVALID-ENTRY-EXIT                         DTSCU004
00139          GO TO P0200-FROM-3-EXIT.                                 DTSCU004
00140      IF L004-QTR-3-Q < 1                                          DTSCU004
00141                  OR                                               DTSCU004
00142          L004-QTR-3-Q > 4                                         DTSCU004
00143          PERFORM P0600-INVALID-ENTRY THRU                         DTSCU004
00144                  P0600-INVALID-ENTRY-EXIT                         DTSCU004
00145          GO TO P0200-FROM-3-EXIT.                                 DTSCU004
00146      MOVE L004-QTR-3-Q TO L004-QTR-5-Q.                           DTSCU004
00147      IF L004-QTR-3-YR < 30                                        DTSCU004
00148          ADD L004-QTR-3-YR 2000 GIVING L004-QTR-5-YR              DTSCU004
00149      ELSE                                                         DTSCU004
00150          ADD L004-QTR-3-YR 1900 GIVING L004-QTR-5-YR.             DTSCU004
00151      PERFORM P2000-CAL-COMP  THRU                                 DTSCU004
00152              P2000-CAL-COMP-EXIT.                                 DTSCU004
00153      PERFORM P3000-CAL-ABS THRU                                   DTSCU004
00154              P3000-CAL-ABS-EXIT.                                  DTSCU004
00155      PERFORM P4000-SLASH-QTR THRU                                 DTSCU004
00156              P4000-SLASH-QTR-EXIT.                                DTSCU004
00157      PERFORM P5000-START-END-DATES THRU                           DTSCU004
00158              P5000-START-END-DATES-EXIT.                          DTSCU004
00159      MOVE WS-STARTING-DATE-9 TO L004-QTR-START-DATE.              DTSCU004
00160      MOVE WS-END-DATE-9 TO L004-QTR-END-DATE.                     DTSCU004
00161      MOVE WS-DUE-DATE-9 TO L004-QTR-DEFAULT-DUE-DATE.             DTSCU004
00162      MOVE WS-ANN-DUE-DATE-9 TO L004-ANN-DEFAULT-DUE-DATE.         DTSCU004
00163  P0200-FROM-3-EXIT.  EXIT.                                        DTSCU004
00164      SKIP3                                                        DTSCU004
00165  P0300-FROM-ABS.                                                  DTSCU004
00166      IF (L004-ABS-QTR < +1)                                       DTSCU004
00167              OR                                                   DTSCU004
00168          (L004-ABS-QTR > +400)                                    DTSCU004
00169          PERFORM P0600-INVALID-ENTRY THRU                         DTSCU004
00170                  P0600-INVALID-ENTRY-EXIT                         DTSCU004
00171          GO TO P0300-FROM-ABS-EXIT.                               DTSCU004
00172      DIVIDE 4 INTO L004-ABS-QTR GIVING WS-END-YR                  DTSCU004
00173        REMAINDER L004-QTR-5-Q.                                    DTSCU004
00174      ADD WS-END-YR 1930 GIVING L004-QTR-5-YR.                     DTSCU004
00175      IF L004-QTR-5-Q = 0                                          DTSCU004
00176          MOVE 4 TO L004-QTR-5-Q                                   DTSCU004
00177          SUBTRACT 1 FROM L004-QTR-5-YR.                           DTSCU004
00178      PERFORM P0100-FROM-5 THRU                                    DTSCU004
00179              P0100-FROM-5-EXIT.                                   DTSCU004
00180  P0300-FROM-ABS-EXIT.  EXIT.                                      DTSCU004
00181      SKIP3                                                        DTSCU004
00182  P0400-FROM-DATE.                                                 DTSCU004
00183      MOVE L004-DATE TO WS-DUE-DATE-9.                             DTSCU004
00184      MOVE WS-DUE-YR TO L004-QTR-5-YR.                             DTSCU004
00185      IF WS-DUE-MO < 04                                            DTSCU004
00186          MOVE 1 TO L004-QTR-5-Q                                   DTSCU004
00187      ELSE                                                         DTSCU004
00188      IF WS-DUE-MO < 07                                            DTSCU004
00189          MOVE 2 TO L004-QTR-5-Q                                   DTSCU004
00190      ELSE                                                         DTSCU004
00191      IF WS-DUE-MO < 10                                            DTSCU004
00192          MOVE 3 TO L004-QTR-5-Q                                   DTSCU004
00193      ELSE                                                         DTSCU004
00194          MOVE 4 TO L004-QTR-5-Q.                                  DTSCU004
00195      PERFORM P0100-FROM-5 THRU                                    DTSCU004
00196              P0100-FROM-5-EXIT.                                   DTSCU004
00197  P0400-FROM-DATE-EXIT. EXIT.                                      DTSCU004
00198      SKIP3                                                        DTSCU004
00199  P0500-FROM-COMP.                                                 DTSCU004
00200      IF (L004-NINES-COMPLEMENT-QTR NOT NUMERIC)                   DTSCU004
00201                  OR                                               DTSCU004
00202          (L004-NINES-COMPLEMENT-QTR NOT > 0)                      DTSCU004
00203          PERFORM P0600-INVALID-ENTRY THRU                         DTSCU004
00204                  P0600-INVALID-ENTRY-EXIT                         DTSCU004
00205          GO TO P0500-FROM-COMP-EXIT.                              DTSCU004
00206      COMPUTE L004-QTR-5-9                                         DTSCU004
00207         = 99999 - L004-NINES-COMPLEMENT-QTR.                      DTSCU004
00208      PERFORM P0100-FROM-5 THRU                                    DTSCU004
00209              P0100-FROM-5-EXIT.                                   DTSCU004
00210  P0500-FROM-COMP-EXIT.  EXIT.                                     DTSCU004
00211      SKIP3                                                        DTSCU004
00212  P0600-INVALID-ENTRY.                                             DTSCU004
00213      MOVE '1' TO L004-RETURN-CODE.                                DTSCU004
00214      MOVE ZERO TO                                                 DTSCU004
00215              L004-NINES-COMPLEMENT-QTR                            DTSCU004
00216              L004-ABS-QTR                                         DTSCU004
00217              L004-DATE                                            DTSCU004
00218              L004-QTR-START-DATE                                  DTSCU004
00219              L004-QTR-END-DATE                                    DTSCU004
00220              L004-QTR-DEFAULT-DUE-DATE                            DTSCU004
00221              L004-ANN-DEFAULT-DUE-DATE.                           DTSCU004
00222  P0600-INVALID-ENTRY-EXIT.  EXIT.                                 DTSCU004
00223      SKIP3                                                        DTSCU004
00224  P0700-CHECK-YR.                                                  DTSCU004
00225      IF L004-QTR-5-YR < 1930                                      DTSCU004
00226                  OR                                               DTSCU004
00227          L004-QTR-5-YR > 2029                                     DTSCU004
00228              PERFORM P0600-INVALID-ENTRY THRU                     DTSCU004
00229                      P0600-INVALID-ENTRY-EXIT.                    DTSCU004
00230  P0700-CHECK-YR-EXIT.  EXIT.                                      DTSCU004
00231      SKIP3                                                        DTSCU004
00232  P2000-CAL-COMP.                                                  DTSCU004
00233      COMPUTE L004-NINES-COMPLEMENT-QTR                            DTSCU004
00234          = 99999 - L004-QTR-5-9.                                  DTSCU004
00235  P2000-CAL-COMP-EXIT.  EXIT.                                      DTSCU004
00236      SKIP3                                                        DTSCU004
00237  P3000-CAL-ABS.                                                   DTSCU004
00238      COMPUTE L004-ABS-QTR =                                       DTSCU004
00239         ((L004-QTR-5-YR - 1930) * 4) + L004-QTR-5-Q.              DTSCU004
00240  P3000-CAL-ABS-EXIT.  EXIT.                                       DTSCU004
00241      SKIP3                                                        DTSCU004
00242  P4000-SLASH-QTR.                                                 DTSCU004
00243      MOVE '/'           TO L004-SLASH-LIT.                        DTSCU004
00244      MOVE L004-QTR-3-Q  TO L004-SLASH-Q.                          DTSCU004
00245      MOVE L004-QTR-3-YR TO L004-SLASH-YR.                         DTSCU004
00246                                                                   DTSCU004
00247      MOVE '/'           TO L004-SLASH-5-LIT.                      DTSCU004
00248      MOVE L004-QTR-5-Q  TO L004-SLASH-5-Q.                        DTSCU004
00249      MOVE L004-QTR-5-YR TO L004-SLASH-5-YR.                       DTSCU004
00250  P4000-SLASH-QTR-EXIT.  EXIT.                                     DTSCU004
00251      SKIP3                                                        DTSCU004
00252  P5000-START-END-DATES.                                           DTSCU004
00253      MOVE L004-QTR-5-YR TO                                        DTSCU004
00254                  WS-STARTING-YR                                   DTSCU004
00255                  WS-END-YR                                        DTSCU004
00256                  WS-DUE-YR.                                       DTSCU004
00257      IF L004-QTR-5-Q = 1                                          DTSCU004
00258          MOVE 01 TO WS-STARTING-MO                                DTSCU004
00259          MOVE 03 TO WS-END-MO                                     DTSCU004
00260          MOVE 04 TO WS-DUE-MO                                     DTSCU004
00261          MOVE 31 TO WS-END-DA                                     DTSCU004
00262          MOVE 30 TO WS-DUE-DA                                     DTSCU004
00263      ELSE                                                         DTSCU004
00264      IF L004-QTR-5-Q = 2                                          DTSCU004
00265          MOVE 04 TO WS-STARTING-MO                                DTSCU004
00266          MOVE 06 TO WS-END-MO                                     DTSCU004
00267          MOVE 07 TO WS-DUE-MO                                     DTSCU004
00268          MOVE 30 TO WS-END-DA                                     DTSCU004
00269          MOVE 31 TO WS-DUE-DA                                     DTSCU004
00270      ELSE                                                         DTSCU004
00271      IF L004-QTR-5-Q = 3                                          DTSCU004
00272          MOVE 07 TO WS-STARTING-MO                                DTSCU004
00273          MOVE 09 TO WS-END-MO                                     DTSCU004
00274          MOVE 10 TO WS-DUE-MO                                     DTSCU004
00275          MOVE 30 TO WS-END-DA                                     DTSCU004
00276          MOVE 31 TO WS-DUE-DA                                     DTSCU004
00277      ELSE                                                         DTSCU004
00278          MOVE 10 TO WS-STARTING-MO                                DTSCU004
00279          MOVE 12 TO WS-END-MO                                     DTSCU004
00280          MOVE 01 TO WS-DUE-MO                                     DTSCU004
00281          MOVE 31 TO WS-END-DA                                     DTSCU004
00282          MOVE 31 TO WS-DUE-DA                                     DTSCU004
00283      ADD +1 TO WS-DUE-YR.                                         DTSCU004
00284                                                                   DTSCU004
00285      COMPUTE WS-ANN-DUE-YR = (L004-QTR-5-YR + 1).                 DTSCU004
00286      MOVE 04 TO WS-ANN-DUE-MO.                                    DTSCU004
00287      MOVE 15 TO WS-ANN-DUE-DA.                                    DTSCU004
00288  P5000-START-END-DATES-EXIT.  EXIT.                               DTSCU004
00289      SKIP3                                                        DTSCU004
