CCP COBOL ASSIGNMENT #3

OVERVIEW: the third programming assignment involves:

1) Reading input records from a phone use file (CSCSMS.CSC.PHONE3D)

2) Validating certain fields within each record, such as
customer name, customer number, region-code, telephone number, number of calls, and number of units.

3)  Generating an Error-Report (Output File #1) containing a listing of all phone use records plus appropriate error messages and statistics.  Include total number of erroneous fields, records, and percentage " bad " records.

4)  Generating an Accepted-Records Report (Output File #2) containing
     a)  appropriate heading lines
     b)  a listing of all valid phone use records [edited]
     c)  final report line(s) listing the totals for number of valid records and total
         amount owed to the phone company.

PURPOSE:

1)  To gain experience writing data validation routines in COBOL
2)  To become familiar with the use of multiple output (report) files.

REQUIREMENTS:

To receive full credit for this assignment, you must submit on time:
1)  a listing of the JCL and COBOL programs
2)  the correct Error-Report
3)  the correct Billing-Report
 
NARRATIVE:

Excluding long distance phone class, Illinois Bell charges customers a certain amount per call plus an additional charge per minute.  These charges vary from one region to another.  A call from region "A" to another person in region "A" would be cheaper per call and per minute than if the latter resided in region "B".  There is also a discount if the call is made in non-traffic hours (say after 9:00 p.m. and before 7:00 a.m.) and on weekends [these discounts will NOT be considered in this programming assignment].

The cost to the customer is determined by multiplying the number of calls times the cost/call + number of minutes times the cost/minute:
Note that a cost factor from area "A" to area "B" is the same as the cost factor from area "B" to area "A", etc.
 

                      AREA A     AREA B     AREA C
---------------------------------------------------------
AREA A     cost/call   .05       .08        .10
           cost/min    .03       .06        .08
---------------------------------------------------------
AREA B     cost/call             .05        .07
           cost/min              .03        .05
---------------------------------------------------------
AREA C     cost/call                        .05
           cost/min                         .03
---------------------------------------------------------
 
 

INPUT RECORD DESCRIPTION: (70 columns--block size = 700)

FIELD                    COLUMNS      DATA CLASS

Customer name            1 -20        alphanumeric
Customer number          21-26        numeric
Telephone number         31-40        numeric
area-location            41           alphanumeric
Number of region A calls 43-45        numeric
number of region A min   47-50        numeric
Number of region B calls 53-55        numeric
Number of region B min   57-60        numeric
number of region C calls 63-65        numeric
Number of region C min   67-70        numeric
 

 OUTPUT RECORD DESCRIPTIONS: (column layout up to you ):

[for error report]

STEVE SAMUELS 123456 3123628735 A  050  0300  BCC     0400    012  O*0
                                              NOT NUM              NOT NUM
              583902 708698**** B  040  0400  020     0100    010  0300
BLANK                NOT NUM

etc.

TOTAL ERRONEOUS FIELDS =
TOTAL ERRONEOUS RECORDS =
PERCENTAGE OF BAD RECORDS =

+++++++++++++++
EXTRA CREDIT = 5 points
Instead of the NOT NUMBER statement, put an "*" under every invalid character in the error report.
++++++++++++++
 

[for good Report]

ILLINOIS BELL BILLING SUMMARY
************************************************************************************
NAME           CUSTOMER  PHONE        AREA   REGION A   REGION B   REGION C  TOTAL
               NUMBER    NUMBER       CODE   CHARGE     CHARGE     CHARGE   CHARGE
************************************************************************************
JOEL BERNSTEIN 158934    312-535-5235  A     $35.00     $22.50     $10.00    $57.50
MARGARET DETER 684930    847-575-3623  C     $20.00    $110.15      $0.50   $130.65

extra
TOTAL NUMBER OF CUSTOMERS =
TOTAL AMOUNT OF PHONE BILLS =
 

There is a file, CSCSMS.CSC.PHONE3DG, that contains only good records.  It is strongly suggested that you start this programming assignment using this file, thereby obtaining a good report.  Then you can concentrate on error routines.