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