Internet COBOL

Programming Lab 7

Extension to Credit Card Processing

OVERVIEW:
The credit card company from lab 5 wants to identify customer with potential credit problems. They take several fields from the data file and use them to calculate a risk score, where the higher the risk score, the greater the potential for credit troubles.  This lab will be much longer than previous labs.  GET STARTED EARLY!!!!

Here are the data fields that will be used:

Sample coding for years-at-residence:

IF YEARS-AT-RESIDENCE-IN < 3
  ADD 8 TO SCORE
ELSE IF YEARS-AT-RESIDENCE-IN < 7
  ADD 4 TO SCORE
ELSE IF YEARS-AT-RESIDENCE-IN < 13
  ADD 3 TO SCORE
ELSE
  ADD 1 TO SCORE
END-IF.  (be sure to put a period as it will end ALL the IF statements)

Alternate Coding: (check index for coding specifications)
The EVALUATE statement works will for "nested if" statements:
EVALUATE TRUE
WHEN YEARS-AT-RESIDENCE-IN < 3
   ADD 8 TO SCORE
WHEN YEARS-AT-RESIDENCE-IN < 7
   ADD 4 TO SCORE
WHEN YEARS-AT-RESIDENCE-IN < 13
   ADD 3 TO SCORE
WHEN OTHER
   ADD 1 TO SCORE
END-EVALUATE

Second alternative coding:  (check index for "condition-names")
EVALUATE TRUE
WHEN NEW-TO-RESIDENCE
  ADD 8 TO SCORE
WHEN BETWEEN-3-AND-6-AT-RESIDENCE
  ADD 4 TO SCORE
WHEN BETWEEN-7-AND-12-AT-RESIDENCE
  ADD 3 TO SCORE
WHEN OTHER
  ADD 1 TO SCORE
END-EVALUATE.
The conditional names illustrated here are:
05 YEARS-AT-RESIDENCE-IN               PIC 99.
   88 NEW-TO-RESIDENCE              VALUES 0 THRU 2.
   88 BETWEEN-3-AND-6-AT-RESIDENCE  VALUES 3 THRU 6.
   88 BETWEEN-7-AND-12-AT-RESIDENCE VALUES 7 THRU 12.
   88 OVER-12-AT-RESIDENCE          VALUES 12 THRU 99.
These would be defined for the years-at-residence-in field in the 
input-field specifications in the FILE SECTION in the DATA DIVISION.

After calculating the total risk score for each cardholder, write a record to a report file ONLY if the account holder has a risk score of 20 or higher. If the score is 27 or higher - write them to the report file PLUS put an asterisk next to their score indicating that they are a high risk. Do NOT write out records where the total score is less than 20!

Link to my output:

Link to the data file:

Return to Main Page:

 

Last modified by Bruce White on 02/26/04