This is a demonstration of a simplified Core Banking System implemented in COBOL.
ACCOUNTS.CPY: Data structure for account records.INIT-DB.CBL: Initializes theACCOUNTS.DATfile with sample data.TRANS-PROC.CBL: Handles deposits and withdrawals.REPORT-GEN.CBL: Generates a balance summary report.BANK-MAIN.CBL: Main menu driver for the system.
- GnuCOBOL (OpenCOBOL): You need
cobcinstalled and in your PATH.- Windows: GnuCOBOL for Windows or use msys2
- Linux:
sudo apt-get install gnucobol
Install on MSYS2 MINGW64:
pacman -Sy
pacman -S mingw-w64-x86_64-gnucobol
cobc --versionsudo apt-get install gnucobolSince COBOL programs often call each other, you should compile them as modules or dynamic libraries.
# Set environment variables (Windows)
$env:COB_CONFIG_DIR = "C:\msys64\mingw64\share\gnucobol\config"
$env:COB_COPY_DIR = "C:\msys64\mingw64\share\gnucobol\copy"
# Compile all modules
cobc -m INIT-DB.CBL
cobc -m TRANS-PROC.CBL
cobc -m REPORT-GEN.CBL
cobc -x BANK-MAIN.CBL
# Run the main program
./BANK-MAIN- Database Initialization: Resets the
ACCOUNTS.DATfile to a known state. - Transaction Processing: Supports real-time updates for deposits and withdrawals.
- Reporting: Provides a formatted summary of all accounts and total bank balance.
In this simplified version, the transaction processor uses a temporary file (ACCOUNTS.TMP) to perform updates and simulate a sequential record update process typical in batch COBOL environments.