251test1

Home > Preview

The flashcards below were created by user slc53 on FreezingBlue Flashcards.


  1. define benefits summary table that has 11 offices and 5 benefit types
    • 01 W02-BEN-SUMRY-TBL.
    •   05 W02-OFFICE OCCURS 11 TIMES.
    •     10 W02-BEN-CODE OCCURS 5 TIMES.
    •        15 W02-MONTH-TOTAL
    •                PIC 9(5)V99 VALUE 0.
  2. Put the following in a table for easy searching.
    01  W04-BENEFIT-CODES.
               05      PIC X(11) VALUE '1LIFE      '.
               05      PIC X(11) VALUE '2DENTAL '.
               05      PIC X(11) VALUE '3HOSP      '.
               05      PIC X(11) VALUE '4RRSP      '.
               05      PIC X(11) VALUE '5PENSION '.
    • 01  W04-BENEFIT-TABLE REDEFINES
    •                 W04-BENEFIT-CODES.
    •   05  W04-BENEFIT-ROW OCCURS 5 TIMES
    •         ASCENDING KEY IS W04-BEN-CODE
    •        INDEXED BY W04-BEN-INDX.
    •       10 W04-BEN-CODE PIC 9.
    •       10 W04-BEN-NAME PIC X(10).
    • 01  W04-BEN-FOUND    PIC 99 VALUE 0.
  3. 01  W04-BENEFIT-TABLE REDEFINES
                   W04-BENEFIT-CODES.
      05  W04-BENEFIT-ROW OCCURS 5 TIMES
            ASCENDING KEY IS W04-BEN-CODE
           INDEXED BY W04-BEN-INDX.
                   10 W04-BEN-CODE       PIC 9.
                   10 W04-BEN-NAME       PIC X(10)
    01  W04-BEN-FOUND       PIC 99 VALUE 0.
    Search the table for the benefit code.
    • (wrong INITIALIZE W04-BEN-INDX)
    • SET W04-BEN-INDX TO 1
    • SEARCH ALL W04-BENEFIT-ROW
    •    AT END
    •               DISPLAY 'not found'
    • WHEN W04-BEN-CODE(W04-BEN-INDX) =
    •        W05-EMP-BEN-CODE(W02-BEN-SUB)
    •    SET W04-BEN-FOUND TO W04-BEN-INDX
    •    do something
    • END-SEARCH
    • .
  4. process record in Assign2
    READ

    PERFORM A200-PROCESS-RECORD
         UNTIL W01-AT-EOF
    • perform office-search
    • PERFORM B200-SEARCH-OFFICE
    • PERFORM VARYING W02-BEN-SUB
    •           FROM 1 BY 1
    •           UNTIL W02-BEN-SUB >5
    •   IF W05-BEN-CODE(W02-BEN-SUB) IS NOT
    •                         = SPACES
    •     PERFORM B300-BEN-SEARCH-BENEFIT
    •     ADD W05-EMP-BEN-COST(W02-BEN-SUB)
    •         TO W02-MONTH-TOTAL
    •                 (OFF-FOUND,BEN-FOUND)
    •    END-IF
    • END-PERFORM
    • PERFORM B100-READ-EMP-BEN-FILE
    • .
  5. write office monthly benefits table
    • PERFORM VARYING W2-OFF-SUB
    •                     FROM 1 BY 1
    •                     UNTIL W02-OFF-SUB>11
    •   INITIALIZE W02-OFFICE-TOTAL
    •   MOVE W03-CITY-NAME(W02-OFF-SUB)
    •                      TO W09-OFF-NAME-OUT
    •   PERFORM VARYING W02-BEN-SUB
    •                     FROM 1 BY 1
    •                     UNTIL W02-BEN-SUB > 5
    •     MOVE TOTAL(OFF-SUB,BEN-SUB)
    •                   TO BEN-MONTH-OUT(BEN-SUB)
    •     ADD TOTAL(OFF-SUB,BEN-SUB)
    •                     TO OFF-TOTAL 
    •   END-PERFORM
    •   MOVE OFF-TOTAL TO OFF-TOT-OUT
    •   WRITE OUTPUT-REC FROM DET-LINE
    •   ADD OFF-TOTAL TO COMP-TOTAL
    • END-PERFORM

Card Set Information

Author:
slc53
ID:
336509
Filename:
251test1
Updated:
2017-12-04 22:03:10
Tags:
251test1
Folders:

Description:
251test1
Show Answers:

Home > Flashcards > Print Preview