BA 209 ­ File Management

Program #3 ­ 75 Points

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)

Location
Filed Description
1­10
Credit Card Number ­ key to the file
11­12
Card Type
13­20
Date Issued ­ YYYYMMDD
21­50
Cardholder's Name
51­56
Expiration Date ­ YYYYMM
57­65
Current Balance ­ 9(7)V99
66­74
Amount Charged Year­to­date ­ 9(7)V99
75-83
Payments Received Year­to­date ­ 9(7)V99
84­92
Total Interest Paid Year­to­date ­ 9(7)V99
93­101
Credit Limit ­ 9(7)V99
102­106
Number of Charges Year­to­date ­ 9(5)
107­111
Number of Payments Year­to­date ­ 9(5)
112­116
Number of Late Payments Year­to­date ­ 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 1­10 and the Transaction Code in 11­12.

A1 Transaction - Create a new record on the Credit Card Master File

Location
Field Description
1­10
Credit Card Number
11­12
Transaction Code 'A1'
13­14
Card Type
15­22
Date Issued ­ YYYYMMDD
23­52
Cardholder's Name
53­58
Expiration Date ­ YYYYMM
59­67
Credit Limit ­ 9(7)V99 or blank
68­80
Filler



B1 Transaction - Delete a record from the Credit Card Master File

Location
Field Description
1­10
Credit Card Number
11­12
Transaction Code 'B1'
13­80
Filler



R1 Transaction - Process a credit card charge

Location
Field Description
1­10
Credit Card Number
11­12
Transaction Code 'R1'
13­21
Amount Charged ­ 9(7)V99
22­29
Date Charged ­ YYYYMMDD
30­69
Vendor Name
70-80
Filler

S1 Transaction - Process a payment

Location
Field Description
1­10
Credit Card Number
11­12
Transaction Code 'S1'
13­21
Amount of Payment ­ 9(7)V99
22­30
Amount Paid Toward Interest ­ 9(7)V99
31­38
Date Received ­ YYYYMMDD
39­46
Date Due ­ YYYYMMDD
47­80
Filler



C5 Transaction - Change the credit limit for a charge card

Location
Field Description
1­10
Credit Card Number
11­12
Transaction Code 'C5'
13­21
New Credit Limit ­ 9(7)V99
22­80 Filler
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:

  1. Card Type must exist in the Card Type Table.
  2. Date Issued must be valid. (Numeric, 1-12 month, 1-31 days)
  3. Expiration date must be 6 numeric digits yyyymm.
  4. Cardholder's Name must be non­blank
  5. Credit Limit may be blank but if it is non­blank, it must be numeric, greater than zero and less than or equal to the Maximum Credit Limit for this card type which must be retrieved from the Card Type Table

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 non­blank; 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 non­blank.

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

1­2 Card Type ­ key to the file

3­22 Card Type Description

23­27 Interest Rate ­ 9V9999

28­34 Annual Fee ­ 9(5)V99

35­43 Default Credit Limit ­ 9(7)V99

44­52 Maximum Credit Limit ­ 9(7)V99

53­57 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 XXXX­XXXX­XX

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!