(IN COBOL) For this assignment you will produce a sequential maintenance program
ID: 3682595 • Letter: #
Question
(IN COBOL)
For this assignment you will produce a sequential maintenance program using techniques similar to those in SS3. You are given two files, a "master" file with dealer information called Account-Master-File-In.txt with record specification of:
01 ACCOUNT-MASTER-RECORD.
05 OM-ACCOUNT-NUMBER PIC X(05).
05 OM-ACCOUNT-NAME PIC X(20).
05 OM-DATE-OF-LAST-DEPOSIT PIC X(8).
05 OM-ACCOUNT-BALANCE PIC S9(6)V99.
and a transaction file called Transaction-File-In.txt with record specification of:
01 MAINTENANCE-TRANSACTION-RECORD.
05 MT-TRANSACTION-CODE PIC X.
88 MT-NEW-ACCOUNT VALUE "1".
88 MT-DEPOSIT VALUE "2".
88 MT-WITHDRAWAL VALUE "3".
88 MT-NAME-CHANGE VALUE "4".
88 MT-DELETION VALUE "5".
05 MT-ACCOUNT-NUMBER PIC X(5).
05 MT-DEPOSIT-AMOUNT PIC 9(6)v99.
05 MT-WITHDRAWAL-AMOUNT
REDEFINES MT-DEPOSIT-AMOUNT
PIC 9(6)V99.
05 MT-DEPOSITOR-NAME-FOR-ADD PIC X(20).
88 MT-DEPOSITOR-NAME-MISSING VALUE SPACES.
01 NAME-CHANGE-RECORD
REDEFINES MAINTENANCE-TRANSACTION-RECORD.
05 PIC X(6).
05 MT-DEPOSITOR-NEW-NAME PIC X(20).
05 PIC X(8).
Your task is to apply the transactions in the transaction file Transaction-File-In.txt to produce a "new master" called Account-Master-File-Out.txt. Error transactions
should be copied intact to Error-File.txt.
(Account-Master.txt file)
(Transaction-File.txt)
Explanation / Answer
01 ACCOUNT-MASTER-RECORD.
05 OM-ACCOUNT-NUMBER PIC X(05).
05 OM-ACCOUNT-NAME PIC X(20).
05 OM-DATE-OF-LAST-DEPOSIT PIC X(8).
05 OM-ACCOUNT-BALANCE PIC S9(6)V99.
05 MT-TRANSACTION-CODE PIC X.
88 MT-NEW-ACCOUNT VALUE "1".
88 MT-DEPOSIT VALUE "2".
88 MT-WITHDRAWAL VALUE "3".
88 MT-NAME-CHANGE VALUE "4".
88 MT-DELETION VALUE "5".
05 MT-ACCOUNT-NUMBER PIC X(5).
05 MT-DEPOSIT-AMOUNT PIC 9(6)v99.
05 MT-WITHDRAWAL-AMOUNT REDEFINES MT-DEPOSIT-AMOUNT PIC 9(6)V99.
05 MT-DEPOSITOR-NAME-FOR-ADD PIC X(20).
88 MT-DEPOSITOR-NAME-MISSING VALUE SPACES.
01 NAME-CHANGE-RECORD
REDEFINES MAINTENANCE-TRANSACTION-RECORD.
05 PIC X(6).
05 MT-DEPOSITOR-NEW-NAME PIC X(20).
05 PIC X(8).
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.