Skip to the content.

KICKS/COBOL to Python Conversion

A complete, working example of modernizing CICS/COBOL applications to Python web applications

🎯 Overview

This project demonstrates the full conversion of Doug Lowe’s classic CICS sample application suite from KICKS/COBOL running on MVS 3.8J to a modern Python Flask web application.

What You Get

βœ… Working Python/Flask Application - Run it immediately
βœ… Original COBOL Source Code - See the before and after
βœ… Complete Documentation - 60+ page conversion guide
βœ… Real Production Patterns - Not just theory


πŸš€ Quick Start

# Clone the repository
git clone https://github.com/tsiitz/kicks-to-python.git
cd kicks-to-python

# Install and run
pip install -r requirements.txt
python app.py

# Open http://localhost:5000

Sample Customer Numbers: 400001, 400002, 400003, 400004, 400005


πŸ“š Documentation

Getting Started

Conversion Guide

Reference


πŸ”‘ Key Features

Converted Programs

Transaction Original COBOL Python Route Description
INQ1 CUSTINQ1 /customer/inquiry Basic customer inquiry
INQ2 CUSTINQ2 /customer/inquiry2 Inquiry with browse (PF5/6/7/8)
INQ3 CUSTINQ3 /customer/inquiry3 Inquiry with invoices
MNT1 CUSTMNT1 /customer/maintenance Add/Change/Delete
MENU INVMENU / Application menu

Conversion Highlights

VSAM to SQL:

EXEC CICS READ FILE('CUSTMAS') INTO(CUSTOMER-RECORD) RIDFLD(KEY) END-EXEC

↓↓↓

customer = customer_repo.find_by_number(customer_key)

File Browse to Pagination:

EXEC CICS STARTBR FILE('CUSTMAS') RIDFLD(KEY) END-EXEC
EXEC CICS READNEXT FILE('CUSTMAS') INTO(RECORD) END-EXEC

↓↓↓

customer = customer_repo.get_first()  # PF5
customer = customer_repo.get_next(key)  # PF8

BMS Maps to HTML:


πŸ“Š Architecture Comparison

Original Mainframe Stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   3270 Terminal     β”‚ ← User interface
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   CICS Region       β”‚ ← Transaction processing
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ COBOL Programsβ”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  BMS Maps     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   VSAM Files        β”‚ ← Data storage
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Modern Python Stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Web Browser       β”‚ ← User interface
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ HTTP/HTTPS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Flask Server      β”‚ ← Web framework
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Python Routes β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚Jinja2 Templatesβ”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  SQLite Database    β”‚ ← Data storage
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—„οΈ Data Model

Customer Master (VSAM CUSTMAS β†’ SQL customers)

COBOL Field COBOL Type SQL Column SQL Type
CM-CUSTOMER-NUMBER PIC 9(6) customer_number INTEGER PRIMARY KEY
CM-FIRST-NAME PIC X(20) first_name VARCHAR(20)
CM-LAST-NAME PIC X(30) last_name VARCHAR(30)
CM-ADDRESS PIC X(30) address VARCHAR(30)
CM-CITY PIC X(20) city VARCHAR(20)
CM-STATE PIC XX state CHAR(2)
CM-ZIP-CODE PIC X(10) zip_code VARCHAR(10)

Additional Tables:


πŸŽ“ Learning Resources

For CICS Programmers

If you’re a CICS programmer looking to understand modern web development:

  1. Start Here: Complete Conversion Guide - Full CICS to Python patterns
  2. Then Read: Python Application Guide - Understanding the converted app
  3. Practice With: The working application - clone and run python app.py

For Python Developers

If you’re a Python developer working with legacy systems:

  1. Start Here: Complete Conversion Guide - Understand CICS concepts
  2. Then Read: COBOL Source Documentation - Original COBOL programs
  3. Study: Compare COBOL source with Python implementation

For Everyone


πŸ› οΈ Technology Stack

Python Application

Original COBOL


🎯 Use Cases

Enterprise Modernization

Use this project as a reference for:

Education

Perfect for:

Development

Great starting point for:


πŸ“– What’s in the Repository

kicks-to-python/
β”œβ”€β”€ app.py                          # Flask application
β”œβ”€β”€ models.py                       # Data models
β”œβ”€β”€ database.py                     # Database layer
β”œβ”€β”€ templates/                      # HTML templates
β”‚   β”œβ”€β”€ base.html
β”‚   β”œβ”€β”€ customer_inquiry.html
β”‚   β”œβ”€β”€ customer_inquiry2.html
β”‚   β”œβ”€β”€ customer_inquiry3.html
β”‚   β”œβ”€β”€ customer_maintenance.html
β”‚   └── ...
β”œβ”€β”€ cobol-source/                   # Original COBOL
β”‚   β”œβ”€β”€ CUSTINQ1.cbl
β”‚   β”œβ”€β”€ CUSTINQ2.cbl
β”‚   β”œβ”€β”€ CUSTMNT1.cbl
β”‚   β”œβ”€β”€ INVMENU.cbl
β”‚   β”œβ”€β”€ bms-maps/
β”‚   └── README.md
β”œβ”€β”€ docs/                           # Documentation
β”‚   β”œβ”€β”€ index.md                    # This page
β”‚   β”œβ”€β”€ _config.yml                 # GitHub Pages config
β”‚   └── ...
β”œβ”€β”€ KICKS_TO_PYTHON_CONVERSION_GUIDE.md  # 60+ page guide
β”œβ”€β”€ requirements.txt                # Python dependencies
└── README.md                       # Repository README

🀝 Contributing

We welcome contributions! Here’s how you can help:

Code Contributions

Documentation

Feedback


πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

Attribution:


πŸ™ Acknowledgments

This project builds upon the excellent work of:


πŸ“ž Support

Need help? Here are your options:


🌟 Star the Repository

If this project helps you, please give it a star on GitHub! ⭐

It helps others discover this resource for mainframe modernization.

⭐ Star on GitHub β†’


Documentation

Resources


**Made with ❀️ for the mainframe modernization community**