00001  IDENTIFICATION DIVISION.                                         10/08/10
00002  PROGRAM-ID.             DTSBU430.                                DTSBU430
00003  AUTHOR.                 NGC                                         LV001
00004  DATE-WRITTEN.           OCTOBER 2010.                            DTSBU430
00005  DATE-COMPILED.                                                   DTSBU430
00006                                                                   DTSBU430
00007 *****                                                             DTSBU430
00008 *                                                                 DTSBU430
00009 *    FUNCTION:  GET COUNTS OF WAGE ITEMS NEEDED FOR               DTSBU430
00010 *               ITEM 5 ON THE ETA 581 REPORT.                     DTSBU430
00011 *                                                                 DTSBU430
00012 *    NOTE: THIS PROGRAM USES SEVERAL BENEFIT MODULES THEREFORE    DTSBU430
00013 *          THIS PROGRAM NEEDS THE BENEFIT COMPILE JCL(COB2BBEN)   DTSBU430
00014 *          TO RESOLVE ALL THE NEEDED LOAD MODULES.                DTSBU430
00015 *                                                                 DTSBU430
00016 *    MODIFICATION HISTORY:                                        DTSBU430
00017 *                                                                 DTSBU430
00018 *    10/01/2010  INITIAL DEVELOPMENT                              DTSBU430
00019 *                REFERENCE:                     PROGRAMMER: GD    DTSBU430
00020 *                                                                 DTSBU430
00021 *                                                                 DTSBU430
00022 *                                                                 DTSBU430
00023 *    MM/DD/YYYY  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   DTSBU430
00024 *                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   DTSBU430
00025 *                REFERENCE: XXXXXXXXXXXXXXX     PROGRAMMER: XXX   DTSBU430
00026 *                                                                 DTSBU430
00027 *    DESCRIPTION:                                                 DTSBU430
00028 *                                                                 DTSBU430
00029 *                                                                 DTSBU430
00030 *    RECORDS READ:                                                DTSBU430
00031 *        WAGE MASTER FILE                                         DTSBU430
00032 *                                                                 DTSBU430
00033 *    PRINTED OUTPUTS:                                             DTSBU430
00034 *        NONE.                                                    DTSBU430
00035 *                                                                 DTSBU430
00036 *    RECORDS WRITTEN:                                             DTSBU430
00037 *        DTSIWWGH   EMPLOYER ORIENTED WAGE RECORD                 DTSBU430
00038 *                                                                 DTSBU430
00039 *    MODULES CALLED:                                              DTSBU430
00040 *         EWG960R   WAGE FILE ACCESS MODULE                       DTSBU430
00041 *         DTSBU004  YEAR/QUARTER CONVERSION MODULE                DTSBU430
00042 *                                                                 DTSBU430
00043 *****                                                             DTSBU430
00044                                                                   DTSBU430
00045  ENVIRONMENT DIVISION.                                            DTSBU430
00046      SKIP2                                                        DTSBU430
00047  DATA DIVISION.                                                   DTSBU430
00048                                                                   DTSBU430
00049  WORKING-STORAGE SECTION.                                         DTSBU430
000495 77  PAN-VALET PICTURE X(24) VALUE '001DTSBU430  10/08/10'.       DTSBU430
00050      SKIP3                                                        DTSBU430
00051  01  WRK-AREA.                                                    DTSBU430
00052      05  WRK-ABEND-CD                PIC S9(04)  COMP  VALUE +430.DTSBU430
00053      05  WRK-ERROR-IND               PIC  X(01).                  DTSBU430
00054          88  WRK-ERROR-YES-88         VALUE 'Y'.                  DTSBU430
00055          88  WRK-ERROR-NO-88          VALUE 'N'.                  DTSBU430
00056                                                                   DTSBU430
00057      05  WRK-START-DATE              PIC S9(09)  COMP-3 VALUE +0. DTSBU430
00058      05  WRK-END-DATE                PIC S9(09)  COMP-3 VALUE +0. DTSBU430
00059                                                                   DTSBU430
00060      05  WRK-WAGE-ITEM-CNT           PIC S9(07)  COMP-3 VALUE +0. DTSBU430
00061                                                                   DTSBU430
00062  01  L004-LINK-AREA.                                              DTSBU430
00063  ++INCLUDE DTSIL004                                               DTSBU430
00064                                                                   DTSBU430
00065  01  EWGLINKB-REC.                                                DTSBU430
00066  ++INCLUDE EWGVSMCB                                               DTSBU430
00067                                                                   DTSBU430
00068  ++INCLUDE EWGSEG01                                               DTSBU430
00069                                                                   DTSBU430
00070  ++INCLUDE EWGSEG02                                               DTSBU430
00071                                                                   DTSBU430
00072  ++INCLUDE EWGVSMCD                                               DTSBU430
00073                                                                   DTSBU430
00074                                                                   DTSBU430
00075  LINKAGE SECTION.                                                 DTSBU430
00076                                                                   DTSBU430
00077  01  L430-LINK-AREA.                                              DTSBU430
00078  ++INCLUDE DTSIL430                                               DTSBU430
00079                                                                   DTSBU430
00080  PROCEDURE DIVISION USING L430-LINK-AREA.                         DTSBU430
00081                                                                   DTSBU430
00082      SET WRK-ERROR-NO-88          TO TRUE.                        DTSBU430
00083      EVALUATE TRUE                                                DTSBU430
00084        WHEN L430-CMND-INITIALIZE-88                               DTSBU430
00085         PERFORM I0000-INIT             THRU I0000-EXIT            DTSBU430
00086                                                                   DTSBU430
00087        WHEN L430-CMND-PROCESS-88                                  DTSBU430
00088            PERFORM P0000-PROCESS       THRU P0000-EXIT            DTSBU430
00089                                                                   DTSBU430
00090        WHEN L430-CMND-TERMINATE-88                                DTSBU430
00091            PERFORM T0000-TERMINATE     THRU T0000-EXIT            DTSBU430
00092                                                                   DTSBU430
00093      END-EVALUATE.                                                DTSBU430
00094                                                                   DTSBU430
00095      GOBACK.                                                      DTSBU430
00096                                                                   DTSBU430
00097  I0000-INIT.                                                      DTSBU430
00098      PERFORM I1000-SET-DATES    THRU I1000-EXIT.                  DTSBU430
00099                                                                   DTSBU430
00100      PERFORM I2000-OPEN-FILES   THRU I2000-EXIT.                  DTSBU430
00101                                                                   DTSBU430
00102                                                                   DTSBU430
00103  I0000-EXIT.                                                      DTSBU430
00104      EXIT.                                                        DTSBU430
00105                                                                   DTSBU430
00106  I1000-SET-DATES.                                                 DTSBU430
00107      MOVE L430-SUBJECT-YRQ        TO L004-QTR-5-9.                DTSBU430
00108      PERFORM S004-FROM-5          THRU S004-EXIT.                 DTSBU430
00109      IF L004-VALID-QTR                                            DTSBU430
00110         MOVE L004-QTR-START-DATE  TO WRK-START-DATE               DTSBU430
00111         MOVE L004-QTR-END-DATE    TO WRK-END-DATE                 DTSBU430
00112      ELSE                                                         DTSBU430
00113         DISPLAY 'INVALID SUBJECT QUARTER '                        DTSBU430
00114            L430-SUBJECT-YRQ                                       DTSBU430
00115         PERFORM S999-ABEND        THRU S999-EXIT                  DTSBU430
00116      END-IF.                                                      DTSBU430
00117                                                                   DTSBU430
00118                                                                   DTSBU430
00119      DISPLAY '**************************'.                        DTSBU430
00120      DISPLAY '*      DTSBU430'                                    DTSBU430
00121      DISPLAY '*               '                                   DTSBU430
00122      DISPLAY '*  START:     ' WRK-START-DATE.                     DTSBU430
00123      DISPLAY '*  END  :     ' WRK-END-DATE.                       DTSBU430
00124      DISPLAY '**************************'.                        DTSBU430
00125                                                                   DTSBU430
00126  I1000-EXIT.                                                      DTSBU430
00127      EXIT.                                                        DTSBU430
00128                                                                   DTSBU430
00129  I2000-OPEN-FILES.                                                DTSBU430
00130      SET DBW-OPEN-INPUT                TO TRUE                    DTSBU430
00131      PERFORM S960-WAGE-I               THRU S960-EXIT             DTSBU430
00132      IF NOT DBW-SUCCESSFUL-COMPLETION                             DTSBU430
00133         SET WRK-ERROR-YES-88           TO TRUE                    DTSBU430
00134         SET L430-FILE-CLOSED           TO TRUE                    DTSBU430
00135         MOVE '431'                     TO L430-MSG-ID             DTSBU430
00136         MOVE 'CANNOT OPEN WAGE FILE '  TO L430-MSG-TEXT           DTSBU430
00137         GO TO I2000-EXIT                                          DTSBU430
00138      END-IF.                                                      DTSBU430
00139                                                                   DTSBU430
00140  I2000-EXIT.                                                      DTSBU430
00141      EXIT.                                                        DTSBU430
00142                                                                   DTSBU430
00143  P0000-PROCESS.                                                   DTSBU430
00144      SET DBW-SEQUENTIAL-PROCESSING TO TRUE.                       DTSBU430
00145      SET DBW-READ-SEGMENT          TO TRUE.                       DTSBU430
00146      SET DBW-PROFILE-SEGMENT       TO TRUE.                       DTSBU430
00147                                                                   DTSBU430
00148      PERFORM S960-WAGE-I     THRU S960-EXIT.                      DTSBU430
00149                                                                   DTSBU430
00150      IF DBW-SUCCESSFUL-COMPLETION                                 DTSBU430
00151         PERFORM UNTIL DBW-END-OF-FILE                             DTSBU430
00152            SET DBW-RANDOM-PROCESSING     TO TRUE                  DTSBU430
00153            SET DBW-WAGE-SEGMENT          TO TRUE                  DTSBU430
00154            SET DBW-RESET-POINTERS        TO TRUE                  DTSBU430
00155            PERFORM S960-WAGE-I           THRU S960-EXIT           DTSBU430
00156                                                                   DTSBU430
00157            PERFORM P1200-COUNT-WAGES THRU P1200-EXIT              DTSBU430
00158                UNTIL DBW-NO-RECORD-FOUND                          DTSBU430
00159                                                                   DTSBU430
00160            SET DBW-SEQUENTIAL-PROCESSING TO TRUE                  DTSBU430
00161            SET DBW-READ-SEGMENT          TO TRUE                  DTSBU430
00162            SET DBW-PROFILE-SEGMENT       TO TRUE                  DTSBU430
00163            PERFORM S960-WAGE-I           THRU S960-EXIT           DTSBU430
00164         END-PERFORM                                               DTSBU430
00165      END-IF.                                                      DTSBU430
00166                                                                   DTSBU430
00167      MOVE WRK-WAGE-ITEM-CNT              TO L430-WAGE-ITEM-CNT.   DTSBU430
00168                                                                   DTSBU430
00169  P0000-EXIT.                                                      DTSBU430
00170      EXIT.                                                        DTSBU430
00171                                                                   DTSBU430
00172                                                                   DTSBU430
00173 **************************************************************    DTSBU430
00174 *  P1200 FINDS ALL THE WAGE SEGMENT ASSOCIATED WITH THE SSN       DTSBU430
00175 *  AND SELECTS THOSE FROM 2001.                                   DTSBU430
00176 **************************************************************    DTSBU430
00177                                                                   DTSBU430
00178  P1200-COUNT-WAGES.                                               DTSBU430
00179                                                                   DTSBU430
00180      SET DBW-READ-SEGMENT          TO TRUE.                       DTSBU430
00181      PERFORM S960-WAGE-I           THRU S960-EXIT.                DTSBU430
00182                                                                   DTSBU430
00183      IF DBW-NO-RECORD-FOUND                                       DTSBU430
00184          GO TO P1200-EXIT.                                        DTSBU430
00185                                                                   DTSBU430
00186                                                                   DTSBU430
00187      IF WGD-AFFI-CODE = 1                                         DTSBU430
00188          GO TO P1200-EXIT                                         DTSBU430
00189      ELSE                                                         DTSBU430
00190         IF WGD-ACTIVITY-DATE >= WRK-START-DATE                    DTSBU430
00191         AND WGD-ACTIVITY-DATE <= WRK-END-DATE                     DTSBU430
00192            ADD +1  TO WRK-WAGE-ITEM-CNT                           DTSBU430
00193         END-IF                                                    DTSBU430
00194      END-IF.                                                      DTSBU430
00195                                                                   DTSBU430
00196  P1200-EXIT.                                                      DTSBU430
00197      EXIT.                                                        DTSBU430
00198                                                                   DTSBU430
00199  S004-FROM-5.                                                     DTSBU430
00200      SET L004-FROM-5 TO TRUE.                                     DTSBU430
00201      GO TO S004-QTR.                                              DTSBU430
00202                                                                   DTSBU430
00203  S004-QTR.                                                        DTSBU430
00204      CALL 'DTSBU004' USING L004-LINK-AREA.                        DTSBU430
00205  S004-EXIT.                                                       DTSBU430
00206      EXIT.                                                        DTSBU430
00207                                                                   DTSBU430
00208  S960-WAGE-I.                                                     DTSBU430
00209      IF DBW-WAGE-SEGMENT                                          DTSBU430
00210          CALL 'EWG960D'  USING VSAM-WAGEDATA-CONTROL-BLOCK        DTSBU430
00211                                 WGD-SEGMENT-TWO                   DTSBU430
00212      ELSE                                                         DTSBU430
00213          CALL 'EWG960D'  USING VSAM-WAGEDATA-CONTROL-BLOCK        DTSBU430
00214                                 WGP-SEGMENT-ONE.                  DTSBU430
00215  S960-EXIT.                                                       DTSBU430
00216      EXIT.                                                        DTSBU430
00217                                                                   DTSBU430
00218  S999-ABEND.                                                      DTSBU430
00219      CALL 'DTSBU999' USING WRK-ABEND-CD.                          DTSBU430
00220  S999-EXIT.                                                       DTSBU430
00221      EXIT.                                                        DTSBU430
00222                                                                   DTSBU430
00223  T0000-TERMINATE.                                                 DTSBU430
00224                                                                   DTSBU430
00225      DISPLAY ' '.                                                 DTSBU430
00226      DISPLAY ' '.                                                 DTSBU430
00227                                                                   DTSBU430
00228      DISPLAY '*** DTSBU430 TERMINATION STATISTICS ***'.           DTSBU430
00229                                                                   DTSBU430
00230      DISPLAY '  '.                                                DTSBU430
00231      DISPLAY 'WAGE ITEMS                                :'        DTSBU430
00232              WRK-WAGE-ITEM-CNT.                                   DTSBU430
00233                                                                   DTSBU430
00234      SET DBW-CLOSE-DATASET   TO TRUE.                             DTSBU430
00235      PERFORM S960-WAGE-I     THRU S960-EXIT.                      DTSBU430
00236                                                                   DTSBU430
00237  T0000-EXIT.                                                      DTSBU430
00238      EXIT.                                                        DTSBU430
00239                                                                   DTSBU430
