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