CSC 203-903 COBOL ASSIGNMENT #5

Due Monday, June 4, 2001

GRADING:  This program will be graded on a 50 point basis. A 10% penalty per week applies if you miss the due date. The assignments will NOT be accepted after June 15, 2001 which is the Friday after the final exam, Since the final exam is our last class session, if the assignment is submitted after that, it will have to be by email in a form that the instructor can readily decipher.

OBJECTIVES: The fifth COBOL programming assignment involves:

  1. Reading input records from a sales file (SALES5.TXT) containing an agent number, quarter sold, region, and up to five insurance codes.
  2. Reading input records from a name file (NAMES5.TXT) containing agent number and agent name into a one-dimensional table within your program.
  3. Looking up the region name by accessing a hardcoded Region file within your program. The data that you need to build this table is in REGION5.TXT.
  4. Using the COBOL Copy function to bring an insurance table (VALUES5.TXT) into your program.
  5. Generating an agent report with one detail line for each input record and a grand total line containing number of policies and total premium collected.

PURPOSE: To gain experience writing COBOL programs involving table handling techniques.

REQUIREMENTS: To receive full credit for this assignment, you must submit, ON TIME:

  1. a listing of your COBOL program that includes one COPY member table, a hardcoded table and an allocated table populated from a file.
  2. an acceptable report
  3. use of a binary search (SEARCH ALL) to read the names table.

PROGRAM 5 NARRATIVE:
The CEO of a small insurance company consisting of 24 agents is interested in obtaining a report detailing premiums earned for each record read showing an employee number and name, a quarter sold, a region name, the number of policies sold, and total amount of premiums.


PROGRAM 5 INPUT SPECIFICATIONS:

for NAMES5.TXT (record length = 25)

FIELD COLUMNS DATA CLASS
agent number  1-5 numeric
agent name 6-25 alphanumeric

for SALES5.TXT (record length = 28)

FIELD COLUMNS DATA CLASS
agent number  1-5 numeric
quarter sold 7 numeric
region where sold 9-10 numeric 
number of ins. codes 12 numeric
insurance codes 14-28 numeric (each insurance code consists of a 3-digit number representing a sex, type-policy, risk-factor)

Use COPY, in Working Storage, for VALUES5.TXT, the insurance table, to bring it into your program.

for REGION5.TXT (record length = 23)

FIELD COLUMNS DATA CLASS
Region number 1-2 numeric
Region name 3-23 alphanumeric


PROGRAM 5 OUTPUT SPECIFICATIONS:

SALES REPORT

AGENT NO    AGENT NAME       REGION     QUARTER    # POLICIES    PREMIUM

12345              BILLIE HOLIDAY  CHICAGO          1                      4                 $640.00
23456              TONY BENNETT   ATLANTA          3                      5              $1,525.00
etc.                   etc.                           etc.                     etc.                  etc.                  etc.
etc.                   etc.                           etc.                     etc.                  etc.                  etc.

TOTALS                                                                                              9              $2,165.00