00001  IDENTIFICATION DIVISION.                                         11/19/98
00002  PROGRAM-ID.             DTSBER61.                                DTSBER61
00003  AUTHOR.                 MT DEPT OF LABOR/UI PROGRAMMING SECTION.    LV003
00004  DATE-WRITTEN.           APRIL 1996.                              DTSBER61
00005  DATE-COMPILED.                                                   DTSBER61
00006      SKIP3                                                        DTSBER61
00007 *****                                                             DTSBER61
00008 *                                                                 DTSBER61
00009 *    FUNCTION:  CONTROL RECORD BUILD FOR RQC REPORT DELINQUENCY   DTSBER61
00010 *               (CS061) SAMPLING.                                 DTSBER61
00011 *                                                                 DTSBER61
00012 *                                                                 DTSBER61
00013 *    MODIFICATION HISTORY:                                        DTSBER61
00014 *                                                                 DTSBER61
00015 * 04-25-96 INITIAL DEVELOPMENT                                    DTSBER61
00016 *          REFERENCE RFP #RAP             AUTHOR OF CHANGE - SFW  DTSBER61
00017 *                                                                 DTSBER61
00018 * 11-17-98 MODIFIED TO MEET DUTAS PROGRAMMING SPECIFICATIONS.        CL**2
00019 *          REFERENCE RFP #****            AUTHOR OF CHANGE - DVS     CL**2
00020 *                                                                 DTSBER61
00021 * MM-DD-YY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     CL**2
00022 *          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     CL**2
00023 *          REFERENCE RFP #****            AUTHOR OF CHANGE - XXX     CL**2
00024 *                                                                    CL**2
00025 *                                                                 DTSBER61
00026 *    DESCRIPTION:                                                 DTSBER61
00027 *                                                                 DTSBER61
00028 *        THIS MODULE READS AN INPUT PARM AND COUNTS THE NUMBER    DTSBER61
00029 *        OF RECORDS IN THE RQC UNIVERSE IN ORDER TO PRODUCE A     DTSBER61
00030 *        CONTROL RECORD.                                          DTSBER61
00031 *                                                                 DTSBER61
00032 *                                                                 DTSBER61
00033 *    RECORDS READ:                                                DTSBER61
00034 *                                                                 DTSBER61
00035 *        RQC CS061 UNIVERSE FILE.                                 DTSBER61
00036 *        PARM FILE.                                               DTSBER61
00037 *                                                                 DTSBER61
00038 *                                                                 DTSBER61
00039 *    PRINTED OUTPUTS:                                             DTSBER61
00040 *                                                                 DTSBER61
00041 *        NONE.                                                    DTSBER61
00042 *                                                                 DTSBER61
00043 *                                                                 DTSBER61
00044 *    RECORDS WRITTEN:                                             DTSBER61
00045 *                                                                 DTSBER61
00046 *        RQC CS061 CONTROL RECORD.                                DTSBER61
00047 *                                                                 DTSBER61
00048 *                                                                 DTSBER61
00049 *    MODULES CALLED:                                              DTSBER61
00050 *                                                                 DTSBER61
00051 *        NONE.                                                    DTSBER61
00052 *                                                                 DTSBER61
00053 *                                                                 DTSBER61
00054 *****                                                             DTSBER61
00055      EJECT                                                        DTSBER61
00056  ENVIRONMENT DIVISION.                                            DTSBER61
00057      SKIP2                                                        DTSBER61
00058  INPUT-OUTPUT SECTION.                                            DTSBER61
00059      SKIP1                                                        DTSBER61
00060  FILE-CONTROL.                                                    DTSBER61
00061      SELECT PARM-FILE     ASSIGN TO PARMIN.                       DTSBER61
00062      SELECT UNIVERSE-FILE ASSIGN TO FILEIN.                       DTSBER61
00063      SELECT CONTROL-FILE  ASSIGN TO CNTRFILE.                     DTSBER61
00064      SKIP3                                                        DTSBER61
00065  DATA DIVISION.                                                   DTSBER61
00066      SKIP3                                                        DTSBER61
00067  FILE SECTION.                                                    DTSBER61
00068      SKIP2                                                        DTSBER61
00069  FD  PARM-FILE                                                    DTSBER61
00070      RECORDING MODE IS F                                          DTSBER61
00071      BLOCK CONTAINS 0 RECORDS.                                    DTSBER61
00072  01  PARM-REC.                                                    DTSBER61
00073      05  PARM-RANDOM-NUMBER          PIC  9(03).                  DTSBER61
00074      05  FILLER                      PIC  X(01).                  DTSBER61
00075      05  PARM-NUMBER-SAMPLED         PIC  9(04).                  DTSBER61
00076      05  FILLER                      PIC  X(01).                  DTSBER61
00077      05  PARM-SAMPLE-TYPE            PIC  X(02).                  DTSBER61
00078      05  FILLER                      PIC  X(01).                  DTSBER61
00079      05  PARM-YYYYQ                  PIC  9(05).                  DTSBER61
00080      05  FILLER REDEFINES PARM-YYYYQ.                             DTSBER61
00081          10  PARM-YYYY               PIC  9(04).                  DTSBER61
00082          10  PARM-Q                  PIC  9(01).                  DTSBER61
00083      05  FILLER                      PIC  X(63).                  DTSBER61
00084      SKIP2                                                        DTSBER61
00085  FD  UNIVERSE-FILE                                                DTSBER61
00086      RECORDING MODE IS F                                          DTSBER61
00087      BLOCK CONTAINS 0 RECORDS.                                    DTSBER61
00088  01  UNIVERSE-REC                    PIC  X(60).                  DTSBER61
00089      SKIP2                                                        DTSBER61
00090  FD  CONTROL-FILE                                                 DTSBER61
00091      RECORDING MODE IS F                                          DTSBER61
00092      BLOCK CONTAINS 0 RECORDS.                                    DTSBER61
00093  01  CONTROL-REC                     PIC  X(33).                  DTSBER61
00094      EJECT                                                        DTSBER61
00095  WORKING-STORAGE SECTION.                                         DTSBER61
000955 77  PAN-VALET PICTURE X(24) VALUE '003DTSBER61  11/19/98'.       DTSBER61
00096      SKIP3                                                        DTSBER61
00097  01  WRK-AREA.                                                    DTSBER61
00098      05  WRK-ABEND-CD                PIC S9(04)  COMP  VALUE +61. DTSBER61
00099      05  FILE-DONE-IND               PIC  X(01)  VALUE 'N'.       DTSBER61
00100          88  FILE-DONE                           VALUE 'Y'.       DTSBER61
00101      SKIP1                                                        DTSBER61
00102  01  WS-CONTROL-REC.                                              DTSBER61
00103      05  CNTR-RECORD-TYPE            PIC  X(05)  VALUE 'CS061'.   DTSBER61
00104      05  CNTR-TRANS-TYPE             PIC  X(01)  VALUE '1'.       DTSBER61
00105      05  CNTR-SESA-ID                PIC  X(02)  VALUE 'DC'.         CL**3
00106      05  CNTR-RANDOM-NUMBER          PIC  9(03).                  DTSBER61
00107      05  CNTR-NUMBER-SAMPLED         PIC  9(04).                  DTSBER61
00108      05  CNTR-RECORD-COUNT           PIC  9(08)  VALUE 0.         DTSBER61
00109      05  CNTR-SAMPLE-TYPE            PIC  X(02).                  DTSBER61
00110      05  CNTR-YYYYQ                  PIC  9(05).                  DTSBER61
00111      05  FILLER                      PIC  X(03)  VALUE '000'.     DTSBER61
00112      EJECT                                                        DTSBER61
00113  PROCEDURE DIVISION.                                              DTSBER61
00114      SKIP2                                                        DTSBER61
00115      PERFORM I1000-INITIATE THRU I1000-EXIT.                      DTSBER61
00116      PERFORM P1000-SPIN-THRU-UNIVERSE THRU P1000-EXIT             DTSBER61
00117         UNTIL FILE-DONE.                                          DTSBER61
00118      PERFORM T1000-TERMINATE THRU T1000-EXIT.                     DTSBER61
00119      SKIP2                                                        DTSBER61
00120      GOBACK.                                                      DTSBER61
00121      EJECT                                                        DTSBER61
00122  I1000-INITIATE.                                                  DTSBER61
00123      SKIP1                                                        DTSBER61
00124      OPEN INPUT  PARM-FILE UNIVERSE-FILE                          DTSBER61
00125           OUTPUT CONTROL-FILE.                                    DTSBER61
00126      READ PARM-FILE                                               DTSBER61
00127         AT END                                                    DTSBER61
00128             DISPLAY ' DTSBER61 - MISSING PARM REC '                  CL**2
00129             PERFORM S999-ABEND THRU S999-EXIT.                    DTSBER61
00130      SKIP1                                                        DTSBER61
00131      IF PARM-RANDOM-NUMBER NUMERIC                                DTSBER61
00132          MOVE PARM-RANDOM-NUMBER TO CNTR-RANDOM-NUMBER            DTSBER61
00133      ELSE                                                         DTSBER61
00134          DISPLAY ' DTSBER61 - INVALID RANDOM NUMBER '                CL**2
00135          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBER61
00136      IF (PARM-NUMBER-SAMPLED NUMERIC)                             DTSBER61
00137                   AND                                             DTSBER61
00138         (PARM-NUMBER-SAMPLED > +0)                                DTSBER61
00139          MOVE PARM-NUMBER-SAMPLED TO CNTR-NUMBER-SAMPLED          DTSBER61
00140      ELSE                                                         DTSBER61
00141          DISPLAY ' DTSBER61 - INVALID NUMBER SAMPLED '               CL**2
00142          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBER61
00143      IF PARM-SAMPLE-TYPE = 'A1' OR 'A2' OR 'E1' OR 'O1' OR 'O2'   DTSBER61
00144          MOVE PARM-SAMPLE-TYPE TO CNTR-SAMPLE-TYPE                DTSBER61
00145      ELSE                                                         DTSBER61
00146          DISPLAY ' DTSBER61 - INVALID SAMPLE TYPE '                  CL**2
00147          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBER61
00148      IF (PARM-YYYYQ NUMERIC) AND (PARM-Q = 1 OR 2 OR 3 OR 4)      DTSBER61
00149          MOVE PARM-YYYYQ TO CNTR-YYYYQ                            DTSBER61
00150      ELSE                                                         DTSBER61
00151          DISPLAY ' DTSBER61 - INVALID YYYYQ '                        CL**2
00152          PERFORM S999-ABEND THRU S999-EXIT.                       DTSBER61
00153      DISPLAY '                                   '                DTSBER61
00154         '         1         2         3         4         5'      DTSBER61
00155         '         6         7         8'.                         DTSBER61
00156      DISPLAY '                                   '                DTSBER61
00157         '12345678901234567890123456789012345678901234567890'      DTSBER61
00158         '123456789012345678901234567890'.                         DTSBER61
00159      DISPLAY ' '.                                                 DTSBER61
00160      DISPLAY ' DTSBER61 -     PARM RECORD INPUT: ' PARM-REC.         CL**2
00161      SKIP2                                                        DTSBER61
00162  I1000-EXIT.                                                      DTSBER61
00163      EXIT.                                                        DTSBER61
00164      EJECT                                                        DTSBER61
00165  P1000-SPIN-THRU-UNIVERSE.                                        DTSBER61
00166      SKIP1                                                        DTSBER61
00167      READ UNIVERSE-FILE                                           DTSBER61
00168         AT END                                                    DTSBER61
00169             SET FILE-DONE TO TRUE                                 DTSBER61
00170             GO TO P1000-EXIT.                                     DTSBER61
00171      ADD +1 TO CNTR-RECORD-COUNT.                                 DTSBER61
00172      SKIP2                                                        DTSBER61
00173  P1000-EXIT.                                                      DTSBER61
00174      EXIT.                                                        DTSBER61
00175      EJECT                                                        DTSBER61
00176  T1000-TERMINATE.                                                 DTSBER61
00177      SKIP1                                                        DTSBER61
00178      DISPLAY ' '.                                                 DTSBER61
00179      DISPLAY ' DTSBER61 - CONTROL RECORD OUTPUT: '                   CL**2
00180         WS-CONTROL-REC.                                           DTSBER61
00181      WRITE CONTROL-REC FROM WS-CONTROL-REC.                       DTSBER61
00182      CLOSE PARM-FILE UNIVERSE-FILE                                DTSBER61
00183            CONTROL-FILE.                                          DTSBER61
00184      SKIP2                                                        DTSBER61
00185  T1000-EXIT.                                                      DTSBER61
00186      EXIT.                                                        DTSBER61
00187      EJECT                                                        DTSBER61
00188  S999-ABEND.                                                      DTSBER61
00189      SKIP1                                                        DTSBER61
00190      CALL 'DTSBU999' USING WRK-ABEND-CD.                             CL**2
00191      SKIP2                                                        DTSBER61
00192  S999-EXIT.                                                       DTSBER61
00193      EXIT.                                                        DTSBER61
