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
- Quick Start Guide - Get running in 5 minutes
- GitHub Upload Instructions - Detailed setup instructions
- Quick Reference - Command cheat sheet
Conversion Guide
- Complete Conversion Guide - Full 60+ page guide covering all patterns
- Architecture decisions
- Data migration strategies (VSAM to SQL)
- Program conversion patterns (COBOL to Python)
- Screen conversion (BMS maps to HTML)
- Implementation roadmap
Reference
- Python Application README - Application documentation
- COBOL Source Code README - Original program documentation
- GitHub Repository - View all source code
π 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:
- 3270 green-screen styling preserved
- PF key simulation (F3, F5-F8, F12)
- Field validation maintained
π 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:
products- Product master (VSAM PRODUCT)invoices- Invoice header (VSAM INVOICE)invoice_items- Invoice line items- Indexes for performance (replaces VSAM alternate indexes)
π Learning Resources
For CICS Programmers
If youβre a CICS programmer looking to understand modern web development:
- Start Here: Complete Conversion Guide - Full CICS to Python patterns
- Then Read: Python Application Guide - Understanding the converted app
- Practice With: The working application - clone and run
python app.py
For Python Developers
If youβre a Python developer working with legacy systems:
- Start Here: Complete Conversion Guide - Understand CICS concepts
- Then Read: COBOL Source Documentation - Original COBOL programs
- Study: Compare COBOL source with Python implementation
For Everyone
- Complete Conversion Guide - 60+ page comprehensive guide
- Python Application README - Quick start and features
- COBOL Source Documentation - Original programs reference
- GitHub Upload Guide - How to upload to GitHub
π οΈ Technology Stack
Python Application
- Flask 3.0 - Web framework
- SQLite 3 - Database
- Jinja2 - Template engine
- Python 3.8+ - Programming language
Original COBOL
- MVS 3.8J TK4 - Operating system
- KICKS - CICS replacement
- COBOL (ANSI) - Programming language
- VSAM KSDS - File system
- BMS - Screen definition
π― Use Cases
Enterprise Modernization
Use this project as a reference for:
- Planning mainframe modernization projects
- Training staff on conversion techniques
- Prototyping new architectures
- Cost estimation for conversions
Education
Perfect for:
- Teaching CICS programming concepts
- Demonstrating legacy system modernization
- Learning Python/Flask with real examples
- Understanding VSAM to SQL migration
Development
Great starting point for:
- Your own conversion projects
- Proof-of-concept demonstrations
- Architecture evaluation
- Pattern library creation
π 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
- Add more program conversions (ORDRENT, CUSTINQ3, etc.)
- Improve error handling
- Add unit tests
- Enhance documentation
Documentation
- Fix typos and clarify explanations
- Add more examples
- Translate to other languages
- Create video tutorials
Feedback
- Report bugs via GitHub Issues
- Suggest improvements
- Share your conversion experiences
- Ask questions in Discussions
π License
This project is licensed under the MIT License. See the LICENSE file for details.
Attribution:
- Original COBOL programs based on examples from βCICS for the COBOL Programmerβ by Doug Lowe
- Published by Mike Murach & Associates, Inc.
- KICKS by moshix - https://github.com/moshix/kicks
π Acknowledgments
This project builds upon the excellent work of:
- Doug Lowe - Original CICS sample applications
- Mike Murach & Associates - Publisher of the CICS programming book
- moshix - Creator of KICKS for TSO/MVS
- IBM - CICS, COBOL, and MVS technologies
π Support
Need help? Here are your options:
- π Documentation: Start with this site
- π¬ Discussions: Use GitHub Discussions for questions
- π Bug Reports: Open a GitHub Issue
- π§ Email: Contact through GitHub profile
π Star the Repository
If this project helps you, please give it a star on GitHub! β
It helps others discover this resource for mainframe modernization.