Skip to content

AndrePhilot/MAINTINVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

MAINTINVM – Inventory Master Maintenance Program (COBOL)

Overview

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 Information

  • Program ID: MAINTINVM
  • Author: Andre Philot
  • Date Written: November 7, 2025
  • Installation: COBOL Development Center
  • Language: COBOL
  • Security: Non-Confidential

Business Purpose

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.


Input and Output Files

Input Files

  • OLDMAST
    Existing inventory master file
  • MNTTRAN
    Maintenance transaction file containing add, delete, and change requests

Output Files

  • NEWMAST
    Updated inventory master file
  • ERRTRAN
    File containing invalid or unprocessable maintenance transactions

Maintenance Transaction Types

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

Processing Logic

  1. Open input and output files.
  2. Read the next maintenance transaction when needed.
  3. Read the next inventory master record when needed.
  4. Compare master and transaction item numbers.
  5. 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
  6. Write updated or unchanged records to the new master file.
  7. Perform file status checks on all writes.
  8. Continue processing until both files reach end-of-file.

Key COBOL Concepts Demonstrated

  • 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

Error Handling

  • 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.

Execution Environment

  • Designed for IBM mainframe environments
  • Uses standard sequential files
  • Suitable for IBM-compatible COBOL compilers

Notes

  • 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.

License

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.

About

MAINTINVM is a batch-oriented COBOL program that performs maintenance on an inventory master file using maintenance transactions. This program demonstrates classic master/transaction file maintenance logic commonly used in enterprise mainframe systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages