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