From the course: COBOL Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Updating records in a master file

Updating records in a master file - COBOL Tutorial

From the course: COBOL Essential Training

Start my 1-month free trial

Updating records in a master file

- [Instructor] In addition to inserting new records into a master file, it is common to have a transaction file that contains changes and maybe even some deletions. For example, let's say it's an employee master file. Employees could change their name, or employees might even leave the company, so you might have to update an existing employee record, and you might have to remove a record. The process flow is that we start with our update employee program, which takes as input the master employee file and the employee transaction file. It is important to note that both the master file and the transaction file must be sorted by the employee ID prior to coming into this program. If you're not familiar how to sort a file, check out my video on sorting. Every record from the master employee file is read in and checked against the transaction file for changes or even deletions. If none exist, it is written directly to the new…

Contents