Sequential Update Programming Assignment

This program is a sequential update of a student master file. Your program must read the master file and the transactions file and create a new master file. You must also create both a transaction register of all good transactions (the ones that were acted upon and affected the file) and an exception/error report of all bad transactions. Both reports should include data and a message explaining what happened.

The master file is called SEQMST99.DAT and is located on the Web site. The layout of the master file is:

1 - 8

Identification Number

9 - 10

Title Code

11 - 32

Name (last/first m)

33 - 54

Street Address

55 - 72

City

73 - 74

State

75 - 79

ZIP

80 - 85

Total amount due

86 - 91

Total amount paid

92-93

Major

94

Number of Courses

95-99

Course 1

100 - 104

Course 2

105 - 109

Course 3

110 - 114

Course 4

115-119

Course 5

120 - 124

Course 6

125 - 129

Course 7

The transaction file is called TRANS99.DAT and is located on the Web site. The records are 131 characters long. There are six different transaction records: one for an add, one for a delete and four types of records for changes. These are shown in the descriptions/layouts below.

ADD: Add transactions have the same layout as the master file except that they have a space in character position 130 and the Record Action Code of A in character position 131. In processing the add transaction, you are simply using the information on the transaction to set-up a new master record of 129 characters. A successful ADD is listed on the transaction register. An unsuccessful add appears on the error report.

DELETE: Delete transactions have only the identification number in character positions 1 - 8 and the Record Action Code of D in character position 131. In processing the delete transaction, you simply by-pass the writing of a new master. A successful DELETE is reported on the transaction register. An unsuccessful delete appears on the error report.

CHANGE: There are four types of change transactions as shown below. A successful CHANGE is reported on the transaction register. An unsuccessful change appears on the error report. Changes should allow the fields on the master (with the exception of the identification number field which cannot be changed) to have data added to them, to have data changed in them, to have data deleted in them and to remain as they are. The deletion of a field will be handled by placing a hyphen in the last character of the field.

1 - 8

Identification Number

9 - 14

Total amount due

15 - 20

Total amount paid

21 -129

Blank

130

Change Type set to 2

131

Record Action Code set to C

1 - 8

Identification Number

9 - 10

Major

11

Number of Courses

12 - 16

Course 1

17 - 21

Course 2

22 - 26

Course 3

27 - 31

Course 4

32 - 36

Course 5

37 - 41

Course 6

42 - 46

Course 7

47 - 129

Blank

130

Change Type set to 3

131

Record Action Code set to C

1 - 8

Identification Number

9

Course Action Code

1 = Add a Course

2 = Change a Course

3 = Delete a Course

10 - 14

Old Course

15 - 19

New Course

20 -129

Blank

130

Change Type set to 4

131

Record Action Code set to C

 

Transaction Register: Listing of all good transactions that were successfully processed and the action taken. At the end of this report, there should be a page of control totals. This needs to show the number of master records read, the number of new master records written, the number of transactions read, the number of successful adds, changes, and deletes, and the number of unsuccessful adds, changes, and deletes. To balance the results, the number of transactions in all categories should be equal to the number of transactions read and the number of master records read plus good adds, minus good deletes should equal the number of new master records. A message should be written telling whether the processing is in balance or out of balance.

Example of control totals:

Transactions Read

612

Adds

145

Processed

100

Rejected

45

Changes

452

Processed

412

Rejected

40

Deletes

15

Processed

12

Rejected

3

Master Read

1516

Master Written

1604

PROCESSING BALANCES

 

Error/Exception Report: This is a listing of all errors. The report should identify the record and that data that was in error and include a message about the problem. Because you are producing two printed reports, you should write this report to disk and when the program is complete, open the file as input and create the report on paper.