MAINTINVM is a batch-oriented COBOL program that performs maintenance on an inventory master file using maintenance transactions.
The program supports adding new inventory records, deleting existing records, and changing selected fields of existing records.
This program demonstrates classic master/transaction file maintenance logic commonly used in enterprise mainframe systems.
- Program ID: MAINTINVM
- Author: Andre Philot
- Date Written: November 7, 2025
- Installation: COBOL Development Center
- Language: COBOL
- Security: Non-Confidential
The program updates the inventory master file based on incoming maintenance transactions.
Depending on the transaction type, the program can:
- Add a new inventory item
- Delete an existing inventory item
- Modify descriptive or pricing fields of an existing item
When master and transaction keys do not match, records are either written unchanged to the new master file or written to an error file.
Processing continues until both the master file and the transaction file reach end-of-file.
- OLDMAST
Existing inventory master file - MNTTRAN
Maintenance transaction file containing add, delete, and change requests
- NEWMAST
Updated inventory master file - ERRTRAN
File containing invalid or unprocessable maintenance transactions
Each transaction includes a transaction code that determines the action to be taken:
- Code 1 – Delete Record
- Code 2 – Add Record
- Code 3 – Change Record
- Open input and output files.
- Read the next maintenance transaction when needed.
- Read the next inventory master record when needed.
- Compare master and transaction item numbers.
- Based on the comparison:
- Add a new record
- Delete an existing record
- Change selected fields
- Write unmatched records unchanged
- Write invalid transactions to the error file
- Write updated or unchanged records to the new master file.
- Perform file status checks on all writes.
- Continue processing until both files reach end-of-file.
- Master/transaction file processing
- Sequential file I/O
- Record matching using key comparison
- Use of 88-level condition names
- Switch-controlled program flow
- Error handling with file status checking
- Data movement and field-level updates
- Use of WORKING-STORAGE flags and control switches
- Invalid or unmatched maintenance transactions are written to ERRTRAN.
- File status codes are checked after each write.
- Processing terminates if a serious file error is detected.
- Designed for IBM mainframe environments
- Uses standard sequential files
- Suitable for IBM-compatible COBOL compilers
- This program is intended for instructional use.
- File layouts are simplified for classroom exercises.
- No restart or recovery logic is implemented.
- Assumes input files are properly sorted by item number.
This program is provided for educational purposes. You are free to study, modify, and extend it as part of your COBOL and mainframe learning journey.