00001  IDENTIFICATION DIVISION.                                         09/12/06
00002  PROGRAM-ID.             DESBD317.                                DESBD317
00003  AUTHOR.                 NGC.                                        LV001
00004  DATE-WRITTEN.           FEBRUARY 2006.                           DESBD317
00005  DATE-COMPILED.                                                   DESBD317
00006                                                                   DESBD317
00007 *****                                                             DESBD317
00008 *                                                                 DESBD317
00009 *    FUNCTION:  ADD YEAR-TO-DATE WAGES TO WESQ RECORDS.           DESBD317
00010 *                                                                 DESBD317
00011 *                                                                 DESBD317
00012 *                                                                 DESBD317
00013 *    MODIFICATION HISTORY:                                        DESBD317
00014 *                                                                 DESBD317
00015 *    02/08/2006  INITIAL DEVELOPMENT                              DESBD317
00016 *                REFERANCE:                     PROGRAMMER: GD    DESBD317
00017 *                                                                 DESBD317
00018 *    MM/DD/YYYY  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   DESBD317
00019 *                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   DESBD317
00020 *                REFERENCE: XXXXXXXXXXXXXXX     PROGRAMMER: XXX   DESBD317
00021 *                                                                 DESBD317
00022 *    DESCRIPTION:                                                 DESBD317
00023 *                                                                 DESBD317
00024 *                                                                 DESBD317
00025 *    RECORDS READ:                                                DESBD317
00026 *        WAGE RECORDS OUTPUT FROM DESBD310                        DESBD317
00027 *                                                                 DESBD317
00028 *    PRINTED OUTPUTS:                                             DESBD317
00029 *        NONE                                                     DESBD317
00030 *                                                                 DESBD317
00031 *    RECORDS WRITTEN:                                             DESBD317
00032 *        DTSIWESQ WAGE RECORDS                                    DESBD317
00033 *                                                                 DESBD317
00034 *    MODULES CALLED:                                              DESBD317
00035 *         NONE                                                    DESBD317
00036 *                                                                 DESBD317
00037 *****                                                             DESBD317
00038                                                                   DESBD317
00039  ENVIRONMENT DIVISION.                                            DESBD317
00040      SKIP2                                                        DESBD317
00041  INPUT-OUTPUT SECTION.                                            DESBD317
00042      SKIP3                                                        DESBD317
00043  FILE-CONTROL.                                                    DESBD317
00044      SELECT WESQ-IN-FILE ASSIGN TO DTSFWESI                       DESBD317
00045             FILE STATUS IS WESQ-IN-STATUS.                        DESBD317
00046                                                                   DESBD317
00047      SELECT WESQ-OUT-FILE ASSIGN TO DTSFWESO                      DESBD317
00048             FILE STATUS IS WESQ-OUT-STATUS.                       DESBD317
00049                                                                   DESBD317
00050  DATA DIVISION.                                                   DESBD317
00051      SKIP2                                                        DESBD317
00052  FILE SECTION.                                                    DESBD317
00053      SKIP2                                                        DESBD317
00054  FD  WESQ-IN-FILE                                                 DESBD317
00055      RECORDING MODE IS F                                          DESBD317
00056      LABEL RECORDS ARE STANDARD                                   DESBD317
00057      BLOCK CONTAINS 0 CHARACTERS.                                 DESBD317
00058      SKIP1                                                        DESBD317
00059  01  WESQ-IN-REC.                                                 DESBD317
00060      10  WESQ-KEY-AREA.                                           DESBD317
00061          15  WESQ-EMP-NO             PIC S9(07)       COMP-3.     DESBD317
00062          15  WESQ-SSN                PIC S9(09)       COMP-3.     DESBD317
00063          15  WESQ-YRQ                PIC S9(05)       COMP-3.     DESBD317
00064                                                                   DESBD317
00065      10  WESQ-DATA-AREA.                                          DESBD317
00066          15  WESQ-EARNINGS           PIC S9(09)V9(02) COMP-3.     DESBD317
00067          15  WESQ-YTD-EARNINGS       PIC S9(11)V9(02) COMP-3.     DESBD317
00068                                                                   DESBD317
00069  FD  WESQ-OUT-FILE                                                DESBD317
00070      RECORDING MODE IS F                                          DESBD317
00071      LABEL RECORDS ARE STANDARD                                   DESBD317
00072      BLOCK CONTAINS 0 CHARACTERS.                                 DESBD317
00073      SKIP1                                                        DESBD317
00074  01  WESQ-OUT-REC           PIC X(25).                            DESBD317
00075                                                                   DESBD317
00076      EJECT                                                        DESBD317
00077  WORKING-STORAGE SECTION.                                         DESBD317
000775 77  PAN-VALET PICTURE X(24) VALUE '001DESBD317  09/12/06'.       DESBD317
00078      SKIP3                                                        DESBD317
00079  01  WRK-AREA.                                                    DESBD317
00080      05  WRK-ERROR-IND               PIC  X(01) VALUE 'N'.        DESBD317
00081          88 WRK-ERROR-YES-88           VALUE 'Y'.                 DESBD317
00082          88 WRK-ERROR-NO-88            VALUE 'N'.                 DESBD317
00083                                                                   DESBD317
00084      05  WRK-MOD-NAME                PIC  X(08) VALUE 'DESBD317'. DESBD317
00085      05  WRK-TRACE-IND               PIC  X(01) VALUE 'N'.        DESBD317
00086                                                                   DESBD317
00087      05  WESQ-IN-STATUS          PIC  X(02) VALUE SPACES.         DESBD317
00088          88  WESQ-IN-OK-88           VALUE ZERO.                  DESBD317
00089          88  WESQ-IN-EOF-88          VALUE '10'.                  DESBD317
00090                                                                   DESBD317
00091      05  WESQ-OUT-STATUS          PIC  X(02) VALUE SPACES.        DESBD317
00092          88  WESQ-OUT-OK-88            VALUE ZERO.                DESBD317
00093                                                                   DESBD317
00094      05  WRK-EMP-NO               PIC S9(07)    COMP-3 VALUE +0.  DESBD317
00095      05  WRK-SSN                  PIC S9(09)    COMP-3 VALUE +0.  DESBD317
00096      05  WRK-YRQ                  PIC  9(05).                     DESBD317
00097      05  FILLER REDEFINES WRK-YRQ.                                DESBD317
00098          10  WRK-YRQ-CCYY         PIC  9(04).                     DESBD317
00099          10  WRK-YRQ-Q            PIC  9(01).                     DESBD317
00100      05  WRK-CURR-YEAR            PIC  9(04).                     DESBD317
00101                                                                   DESBD317
00102      05  WRK-YTD-EARNINGS         PIC S9(11)V99 COMP-3 VALUE +0.  DESBD317
00103                                                                   DESBD317
00104      05  WRK-WESQ-READ-CNT         PIC S9(07)  COMP-3 VALUE +0.   DESBD317
00105      05  WRK-WESQ-WRITE-CNT        PIC S9(07)  COMP-3 VALUE +0.   DESBD317
00106      05  AMT-DISP1                 PIC --,---,---,--9.99.         DESBD317
00107      05  AMT-DISP2                 PIC --,---,---,--9.99.         DESBD317
00108                                                                   DESBD317
00109  PROCEDURE DIVISION.                                              DESBD317
00110                                                                   DESBD317
00111  DESBD317-MAIN.                                                   DESBD317
00112      PERFORM I0000-INIT         THRU I0000-EXIT.                  DESBD317
00113      IF WRK-ERROR-YES-88                                          DESBD317
00114         GO TO DESBD317-MAIN-EXIT.                                 DESBD317
00115                                                                   DESBD317
00116      PERFORM P0000-PROCESS    THRU P0000-EXIT.                    DESBD317
00117                                                                   DESBD317
00118      PERFORM T0000-TERMINATE THRU T0000-EXIT.                     DESBD317
00119                                                                   DESBD317
00120  DESBD317-MAIN-EXIT.                                              DESBD317
00121      GOBACK.                                                      DESBD317
00122                                                                   DESBD317
00123  I0000-INIT.                                                      DESBD317
00124      OPEN INPUT WESQ-IN-FILE.                                     DESBD317
00125      IF NOT WESQ-IN-OK-88                                         DESBD317
00126         DISPLAY 'CANNOT OPEN INPUT FILE ' WESQ-IN-STATUS          DESBD317
00127         SET WRK-ERROR-YES-88  TO TRUE                             DESBD317
00128         GO TO I0000-EXIT                                          DESBD317
00129      END-IF.                                                      DESBD317
00130                                                                   DESBD317
00131      OPEN OUTPUT WESQ-OUT-FILE.                                   DESBD317
00132      IF NOT WESQ-OUT-OK-88                                        DESBD317
00133         DISPLAY 'CANNOT OPEN OUTPUT FILE ' WESQ-OUT-STATUS        DESBD317
00134         SET WRK-ERROR-YES-88  TO TRUE                             DESBD317
00135         GO TO I0000-EXIT                                          DESBD317
00136      END-IF.                                                      DESBD317
00137                                                                   DESBD317
00138      MOVE ZERO                TO WRK-YRQ                          DESBD317
00139                                  WRK-CURR-YEAR.                   DESBD317
00140                                                                   DESBD317
00141  I0000-EXIT.                                                      DESBD317
00142      EXIT.                                                        DESBD317
00143                                                                   DESBD317
00144  P0000-PROCESS.                                                   DESBD317
00145      PERFORM P1200-READ-NEXT-WESQ        THRU P1200-EXIT.         DESBD317
00146      IF WESQ-IN-EOF-88                                            DESBD317
00147         DISPLAY 'INPUT FILE IS EMPTY'                             DESBD317
00148         GO TO P0000-EXIT                                          DESBD317
00149      END-IF.                                                      DESBD317
00150                                                                   DESBD317
00151      PERFORM P1000-PROCESS-FILE          THRU P1000-EXIT          DESBD317
00152         UNTIL WESQ-IN-EOF-88.                                     DESBD317
00153                                                                   DESBD317
00154  P0000-EXIT.                                                      DESBD317
00155      EXIT.                                                        DESBD317
00156                                                                   DESBD317
00157  P1000-PROCESS-FILE.                                              DESBD317
00158 ***  MOVE WESQ-EARNINGS TO AMT-DISP1.                             DESBD317
00159 *    DISPLAY 'P1000 - 1 ' WESQ-EMP-NO '  ' WESQ-SSN               DESBD317
00160 ***     '  ' WESQ-YRQ '  ' AMT-DISP1.                             DESBD317
00161                                                                   DESBD317
00162      IF WESQ-EMP-NO  =  WRK-EMP-NO                                DESBD317
00163      AND WESQ-SSN    = WRK-SSN                                    DESBD317
00164         MOVE WESQ-YRQ                    TO WRK-YRQ               DESBD317
00165         IF WRK-YRQ-CCYY = WRK-CURR-YEAR                           DESBD317
00166            MOVE WRK-YTD-EARNINGS         TO WESQ-YTD-EARNINGS     DESBD317
00167            PERFORM P1300-WRITE-OUTPUT    THRU P1300-EXIT          DESBD317
00168            ADD  WESQ-EARNINGS            TO WRK-YTD-EARNINGS      DESBD317
00169         ELSE                                                      DESBD317
00170            MOVE WRK-YRQ-CCYY             TO WRK-CURR-YEAR         DESBD317
00171            PERFORM P1300-WRITE-OUTPUT    THRU P1300-EXIT          DESBD317
00172            MOVE WESQ-EARNINGS            TO WRK-YTD-EARNINGS      DESBD317
00173         END-IF                                                    DESBD317
00174      ELSE                                                         DESBD317
00175         MOVE WESQ-SSN                    TO WRK-SSN               DESBD317
00176         MOVE WESQ-EMP-NO                 TO WRK-EMP-NO            DESBD317
00177         MOVE WESQ-YRQ                    TO WRK-YRQ               DESBD317
00178         MOVE WRK-YRQ-CCYY                TO WRK-CURR-YEAR         DESBD317
00179         PERFORM P1300-WRITE-OUTPUT       THRU P1300-EXIT          DESBD317
00180         MOVE WESQ-EARNINGS               TO WRK-YTD-EARNINGS      DESBD317
00181      END-IF.                                                      DESBD317
00182                                                                   DESBD317
00183      PERFORM P1200-READ-NEXT-WESQ        THRU P1200-EXIT.         DESBD317
00184                                                                   DESBD317
00185  P1000-EXIT.                                                      DESBD317
00186      EXIT.                                                        DESBD317
00187                                                                   DESBD317
00188  P1200-READ-NEXT-WESQ.                                            DESBD317
00189      READ WESQ-IN-FILE.                                           DESBD317
00190      IF WESQ-IN-OK-88                                             DESBD317
00191         ADD +1                 TO WRK-WESQ-READ-CNT.              DESBD317
00192                                                                   DESBD317
00193  P1200-EXIT.                                                      DESBD317
00194      EXIT.                                                        DESBD317
00195                                                                   DESBD317
00196  P1300-WRITE-OUTPUT.                                              DESBD317
00197 ***  MOVE WESQ-EARNINGS TO AMT-DISP1.                             DESBD317
00198 *    MOVE WESQ-YTD-EARNINGS TO AMT-DISP2.                         DESBD317
00199 *    DISPLAY 'P1300 ' WESQ-EMP-NO '  ' WESQ-SSN                   DESBD317
00200 *       '  ' WESQ-YRQ '  ' AMT-DISP1                              DESBD317
00201 ***     '  ' AMT-DISP2.                                           DESBD317
00202                                                                   DESBD317
00203      WRITE WESQ-OUT-REC       FROM WESQ-IN-REC.                   DESBD317
00204      ADD +1                   TO WRK-WESQ-WRITE-CNT.              DESBD317
00205  P1300-EXIT.                                                      DESBD317
00206      EXIT.                                                        DESBD317
00207                                                                   DESBD317
00208  T0000-TERMINATE.                                                 DESBD317
00209                                                                   DESBD317
00210      DISPLAY ' '.                                                 DESBD317
00211      DISPLAY ' '.                                                 DESBD317
00212                                                                   DESBD317
00213      DISPLAY '*** DESBD317 TERMINATION STATISTICS ***'.           DESBD317
00214                                                                   DESBD317
00215      DISPLAY '  '.                                                DESBD317
00216      DISPLAY 'WESQ INPUT RECORDS READ                          : 'DESBD317
00217              WRK-WESQ-READ-CNT.                                   DESBD317
00218                                                                   DESBD317
00219      DISPLAY '  '.                                                DESBD317
00220      DISPLAY 'OUTPUT RECORDS WRITTEN                           : 'DESBD317
00221              WRK-WESQ-WRITE-CNT.                                  DESBD317
00222                                                                   DESBD317
00223      CLOSE WESQ-IN-FILE  WESQ-OUT-FILE.                           DESBD317
00224                                                                   DESBD317
00225  T0000-EXIT.                                                      DESBD317
00226      EXIT.                                                        DESBD317
