This assignment will require you to write a file maintenance program
for a VSAM file that will process various types of transactions
similar to those that might be found in a credit card company's
billing system. You must create a job with three steps to execute
your program. The first step will use the SORT utility to sort
a dataset for loading into your VSAM file. The second step will
use IDCAMS to create your own VSAM file and load it with this
sorted data. The third step will be the COBOL file maintenance
program.
Credit Card Master File Description - This is a VSAM file.
(This also describes the data that is input to the sort and the
data input to IDCAMS)
| Filed Description | |
| Credit Card Number key to the file | |
| Card Type | |
| Date Issued YYYYMMDD | |
| Cardholder's Name | |
| Expiration Date YYYYMM | |
| Current Balance 9(7)V99 | |
| Amount Charged Yeartodate 9(7)V99 | |
| Payments Received Yeartodate 9(7)V99 | |
| Total Interest Paid Yeartodate 9(7)V99 | |
| Credit Limit 9(7)V99 | |
| Number of Charges Yeartodate 9(5) | |
| Number of Payments Yeartodate 9(5) | |
| Number of Late Payments Yeartodate 9(5) |
STEP 1: Use the MVS SORT utility to sort the data to be
loaded into the Credit Card Master file by Credit Card Number
in ascending sequence. Credit Card Number will be the key to the
VSAM master file.
Input dataset information:
CMS file name: CREDIT DATA D (for testing purposes)
MVS dataset name: $4602.PUBLIC.CREDIT.DATA
Record length=116 Blocksize=23896 Record format=Fixed Blocked
Output dataset information:
Name: any valid temporary dataset name
Record length=116 Blocksize=23896 Record format=Fixed Blocked
STEP 2: Use IDCAMS to delete your VSAM master file, create a new VSAM master file and then load it with the sorted data from Step 1. Refer to the handout on IDCAMS for help with this step.
Credit Card Master File dataset information:
Name: S4602xx.CHARGE.MASTER where 'xx' is your subaccount#
Record length=116 Key Length=10
Freespace=20 Estimated number of records=50
STEP 3: Write a COBOL file maintenance program which will
process a file of transactions using the VSAM Credit Card Master
File created and loaded in step 2 and produce the the reports
described.
Transaction Descriptions:
Transaction dataset information:
CMS file name: CREDIT TRANS D (for testing purposes)
MVS dataset name: $4602.PUBLIC.CREDIT.TRANS
Record length=80 Blocksize=6160 Record format=Fixed Blocked
The format of the transactions will vary by transaction type.
The Credit Card Number will always be in 110 and the Transaction
Code in 1112.
A1 Transaction - Create a new record on the
Credit Card Master File
| Field Description | |
| Credit Card Number | |
| Transaction Code 'A1' | |
| Card Type | |
| Date Issued YYYYMMDD | |
| Cardholder's Name | |
| Expiration Date YYYYMM | |
| Credit Limit 9(7)V99 or blank | |
| Filler |
B1 Transaction - Delete a record from the Credit
Card Master File
| Field Description | |
| Credit Card Number | |
| Transaction Code 'B1' | |
| Filler |
R1 Transaction - Process a credit card charge
| Field Description | |
| Credit Card Number | |
| Transaction Code 'R1' | |
| Amount Charged 9(7)V99 | |
| Date Charged YYYYMMDD | |
| Vendor Name | |
| Filler |
S1 Transaction - Process a payment
| Field Description | |
| Credit Card Number | |
| Transaction Code 'S1' | |
| Amount of Payment 9(7)V99 | |
| Amount Paid Toward Interest 9(7)V99 | |
| Date Received YYYYMMDD | |
| Date Due YYYYMMDD | |
| Filler |
C5 Transaction - Change the credit limit for a charge
card
| Field Description | |
| Credit Card Number | |
| Transaction Code 'C5' | |
| New Credit Limit 9(7)V99 | |
| Filler |
Transaction Processing:
A transaction must pass all validations before it is applied to
the master file. A transaction may have more than one error and
each error should be printed as a separate line on the Error Report.
For every transaction perform the following validations:
1) The Credit Card Number must be ten numeric digits.
2) The Transaction Code must be one of the codes as described
above.
Validate and process each transaction type as follows:
A1 Transaction
Validation:
Processing:
1) Create a new record on the master file for this credit card.
2) Move Credit Card Number, Card Type, Date Issued, Cardholder's Name and Expiration Date to the new record.
3) Move Credit Limit to the new record if it is nonblank; otherwise, retrieve the Default Credit Limit for this card type from the Card Type Table and move it to the new record.
4) Initialize Current Balance, Amount Charged YTD, Payments Received YTD, Total Interest Paid YTD, Number of Charges YTD, Number of Payments YTD and Number of Late Payments YTD to zero.
5) If this credit card already exists on the master file, report
this as an error.
B1 Transaction
Processing:
1) Delete the record from the master file for this credit card.
2) If this credit card does not exist, report this as an error.
R1 Transaction
Validation:
1) Amount Charged must be numeric and greater than zero
2) Date Charged must be a valid date (1-12, 1-31, numeric, must be less than today)
3) Vendor Name must be nonblank.
Processing:
1) Add Amount Charged to Amount Charged YTD and to Current Balance.
2) Increment Number of Charges YTD by one.
3) Update the record on the master file for this credit card.
4) If this credit card does not exist, report this as an error.
S1 Transaction
Validation:
1) Amount of Payment must be numeric and greater than zero.
2) Amount Paid Toward Interest must be numeric and greater than zero.
3) Date Received must be a valid date ( same as above)
4) Date Due must be a valid date. (same as above)
5) Amount of Payment must be at least as much as the minimum payment which is calculated by multiplying Current Balance by Minimum Payment Percentage which must be retrieved from the Card Type Table.
Processing:
1) Add Amount of Payment to Payments Received YTD.
2) Subtract Amount of Payment from Current Balance.
3) Add Amount Paid Toward Interest to Total Interest Paid YTD.
4) Increment Number of Payments YTD by one.
5) If Date Received falls after Date Due then increment Number of Late Payments YTD by one.
6) Update the record on the master file for this credit card.
7) If this credit card does not exist, report this as an error.
C5 Transaction
Validation:
1) New Credit Limit must be numeric and greater than zero.
2) New Credit Limit must be greater than the current Credit Limit.
3) New Credit Limit must be less than or equal to the Maximum Credit Limit for this card type which must be retrieved from the Card Type Table.
4) Number of Late Payments YTD must equal zero.
Processing:
1) Update Credit Limit with New Credit Limit.
2) Update the record on the master file for this credit card.
3) If this credit card does not exist, report this as an error.
Card Type Table Description - The Card Type Table File
is needed for validation, processing and reporting. It is a sequential
file which can be loaded into a table and searched or can be a
VSAM file which can be read using Card Type as the key.
Card Type Table File dataset information:
CMS file name: CARDTYPE TABLE D (for testing purposes)
MVS dataset name: $4602.PUBLIC.CARDTYPE.TABLE (Sequential)
MVS dataset name: $4602.PUBLIC.CARDTYPE.VSAM (Vsam)
Record length=57 Key length=2 blksize=5700
Table File Description:
Location Field Description
12 Card Type key to the file
322 Card Type Description
2327 Interest Rate 9V9999
2834 Annual Fee 9(5)V99
3543 Default Credit Limit 9(7)V99
4452 Maximum Credit Limit 9(7)V99
5357 Minimum Payment Percentage 9V9999
Reports:
1) Error Report Print Credit Card Number and a specific
message for every validation or file processing error which occurs.
This report must have a report title and headings.
2) Activity Report After all transactions are processed,
produce this report as described below.
Print the following fields:
Credit Card Number format as XXXXXXXXXX
Credit Limit
Interest Rate - from the Card Type Table, print as an integer with a '%' (Example: 10%)
Current Balance
Amount Charged YTD
Payments Received YTD
Total Interest Paid YTD
Number of Charges YTD
Number of Payments YTD
Number of Late Payments YTD
Print all records from the master file. Make your report as neat
as possible. Format all dollar amounts appropriately. Include
a report title, descriptive headings and the current date.
Additional Instructions
1) You must code the JCL for this job. Be sure to limit your COBOL
program to 3 seconds of execution time.
2) You may compile your program on CMS but you must execute it
on MVS.
3) I will take off points for failure to follow instructions and poorly formatted output. I will take off more severely for any errors in processing so check your output thoroughly to ensure that it is absolutely correct!