Programming Specifications

 

     Ctrbk3Pseudo

 

Program

 

     Three-Level Control Break

 

Narrative:

 

     Management has requested that the sales information associated with

     the two-level program be aggregated one level higher. Specifically, 

     regional totals are required, in addition to salesman and location 

     totals. Region is the highest level break; that is, one or more 

     locations constitute a region.

         

Input File:

 

     SALES-FILE

 

Input Record Layout:

 

     COLUMNS                    FIELD                       PICTURE

                       

      1-15                   SALESMAN-NAME                   X(15).

      16-21                  ACCOUNT-NUMBER                  9(6)

      22-27                  AMOUNT                          9(4)V99

      28-42                  LOCATION                        X(15)

      43-57                  REGION                          X(15)

     

 

Test Data:

   

      See Threelvl.Dat

 

Report Format:

 

      See Threelvl.txt

Processing Requirements

 

    1.   Read a File of employee records

    2.   For every record read,

         (a) Print the sales information in that record on a detail line.

         (b) Increment the salesman's total associated with the particular

             transaction by the transaction amount.

    3.   Print a location heading prior to the first salesman for each

         location. Begin each location on a new page.

    4.   Print an appropriate heading prior to the first transaction for each

         salesman.

    5.   Print a total line for each salesman whenever salesman changes. Skip

         one line between the last detail line and the salesman total line.

    6.   Print a total line for each location whenever a location changes. Skip

         one line between the last salesman total and the location total line.

    7.   After all records have been read, print a total line for the company as

         a whole. Skip 5 lines prior to printing the company total line.

8.         Modify the above to accommodate a third, and highest, level break on

Region. Accommodate all of the following:

(a)   Begin every region on a new page, with the heading “SALES ACTIVITY

REPORT - _______________ REGION.” Include the regional total at the

End of the page.

(b)   Omit the detailed information on every transaction; that is, include

Only a single line for every salesman showing the salesman’s name

And his or her total.

           ©  Omit the location heading: include the one-line location total.