# CardDemo Application - Project Overview

## Application Summary

**CardDemo** is a comprehensive mainframe credit card management application developed in COBOL, running under CICS for online transaction processing and JCL-driven batch processing. It simulates a full credit card lifecycle including account management, card operations, transaction processing, bill payments, reporting, and user administration. The application is designed to showcase AWS and partner technologies for mainframe migration and modernization scenarios.

**Version:** 1.0.0  
**License:** Apache 2.0  
**Last Updated:** April 2025

---

## Technology Stack

### Core Technologies
| Technology | Usage | Description |
|:-----------|:------|:------------|
| **COBOL** | Primary Language | All business logic implemented in COBOL-85 standard |
| **CICS** | Transaction Processing | Online transaction monitor using pseudo-conversational model |
| **VSAM (KSDS with AIX)** | Data Storage | Primary data store for accounts, cards, customers, transactions |
| **JCL** | Batch Processing | Job control language for batch operations |
| **BMS** | Screen Maps | Basic Mapping Support for 3270 terminal screen definitions |
| **RACF** | Security | External security manager integration |
| **Assembler** | System Utilities | Timer control (MVSWAIT) and date formatting (COBDATFT) |

### Optional Technologies (3 Extension Modules)
| Technology | Module | Description |
|:-----------|:-------|:------------|
| **DB2** | Transaction Type DB2, Auth IMS-DB2-MQ | Relational database for transaction types and fraud logging |
| **IMS DB** | Auth IMS-DB2-MQ | Hierarchical database for authorization data |
| **MQ** | Auth IMS-DB2-MQ, VSAM-MQ | Message queuing for async authorization and account inquiries |

---

## File Inventory

### Repository Structure
```
aws-mainframe-modernization-carddemo/
├── app/                          (Main application source)
│   ├── cbl/          31 files    COBOL programs (base)
│   ├── cpy/          30 files    Copybooks (shared data definitions)
│   ├── cpy-bms/      17 files    BMS copybooks (screen map data)
│   ├── bms/          17 files    BMS screen map definitions
│   ├── jcl/          38 files    JCL batch job scripts
│   ├── asm/           2 files    Assembler source modules
│   ├── csd/           1 file     CICS System Definition file
│   ├── ctl/           1 file     Control files
│   ├── data/         24 files    Sample data (ASCII + EBCDIC)
│   ├── maclib/        2 files    Assembler macro libraries
│   ├── proc/          2 files    JCL procedures
│   ├── catlg/         1 file     Dataset catalog listing
│   ├── scheduler/     2 files    Job scheduler definitions (CA7, Control-M)
│   ├── app-authorization-ims-db2-mq/    Optional: Auth module (40 files)
│   │   ├── cbl/       8 files    COBOL programs
│   │   ├── cpy/       9 files    Copybooks
│   │   ├── cpy-bms/   2 files    BMS copybooks
│   │   ├── bms/       2 files    BMS maps
│   │   ├── csd/       1 file     CSD definitions
│   │   ├── dcl/       1 file     DB2 DCLGEN declarations
│   │   ├── ddl/       2 files    DB2 DDL (table create)
│   │   ├── ims/       8 files    IMS DBD/PSB definitions
│   │   ├── jcl/       5 files    JCL batch jobs
│   │   └── data/      1 file     IMS sample data
│   ├── app-transaction-type-db2/        Optional: Tran type module (27 files)
│   │   ├── cbl/       3 files    COBOL programs
│   │   ├── cpy/       2 files    Copybooks
│   │   ├── cpy-bms/   2 files    BMS copybooks
│   │   ├── bms/       2 files    BMS maps
│   │   ├── csd/       1 file     CSD definitions
│   │   ├── ctl/       7 files    DB2 control files
│   │   ├── dcl/       2 files    DB2 DCLGEN declarations
│   │   ├── ddl/       4 files    DB2 DDL
│   │   └── jcl/       3 files    JCL batch jobs
│   └── app-vsam-mq/                    Optional: VSAM-MQ module (4 files)
│       ├── cbl/       2 files    COBOL programs
│       └── csd/       1 file     CSD definitions
├── diagrams/         12 files    Application flow diagrams (PNG, DrawIO)
├── samples/                      Sample compilation JCL and M2 configs
├── scripts/          12+ files   Build and deployment scripts
├── README.md                     Project documentation
├── LICENSE                       Apache 2.0 license
├── NOTICE                        Attribution notices
├── CONTRIBUTING.md               Contribution guidelines
└── CODE_OF_CONDUCT.md            Code of conduct
```

### File Count Summary

| Category | File Type | Count | Lines of Code |
|:---------|:----------|------:|-------------:|
| **COBOL Programs (Base)** | .cbl/.CBL | 31 | 20,650 |
| **COBOL Programs (Auth IMS-DB2-MQ)** | .cbl/.CBL | 8 | 4,344 |
| **COBOL Programs (Tran Type DB2)** | .cbl | 3 | 4,037 |
| **COBOL Programs (VSAM-MQ)** | .cbl | 2 | 1,144 |
| **Copybooks (Base)** | .cpy/.CPY | 30 | 2,786 |
| **BMS Copybooks (Base)** | .CPY | 17 | 5,632 |
| **Auth Module Copybooks** | .cpy/.CPY | 11 | — |
| **Tran Type Module Copybooks** | .cpy | 4 | — |
| **BMS Maps (Base)** | .bms | 17 | 4,472 |
| **BMS Maps (Optional)** | .bms | 4 | — |
| **JCL Scripts (Base)** | .jcl/.JCL | 38 | 2,429 |
| **JCL Scripts (Optional)** | .jcl/.JCL | 8 | — |
| **Assembler** | .asm | 2 | 114 |
| **Total COBOL Programs** | | **44** | **~30,175** |
| **Total Copybooks** | | **62** | **~8,400+** |
| **Total Source Files** | | **~200+** | **~45,000+** |

---

## Application Modules

### 1. Base Application (Core)
The core credit card management system with online CICS transactions and batch processing.

**Functional Areas:**
- User Authentication & Sign-on (COSGN00C)
- Main Menu Navigation (COMEN01C)
- Account View/Update (COACTVWC, COACTUPC)
- Credit Card List/View/Update (COCRDLIC, COCRDSLC, COCRDUPC)
- Transaction List/View/Add (COTRN00C, COTRN01C, COTRN02C)
- Bill Payment (COBIL00C)
- Transaction Reports (CORPT00C)
- Admin Menu (COADM01C)
- User Management CRUD (COUSR00C-03C)
- Batch Account Processing (CBACT01C-04C)
- Batch Customer Processing (CBCUS01C)
- Batch Transaction Processing (CBTRN01C-03C)
- Batch Statement Generation (CBSTM03A, CBSTM03B)
- Export/Import (CBEXPORT, CBIMPORT)
- Date Utility (CSUTLDTC)
- Wait Utility (COBSWAIT)

### 2. Optional: Authorization with IMS, DB2, and MQ
Credit card authorization processing using MQ messaging, IMS hierarchical databases, and DB2 fraud logging.

**Programs:** COPAUA0C, COPAUS0C, COPAUS1C, COPAUS2C, CBPAUP0C, DBUNLDGS, PAUDBLOD, PAUDBUNL

### 3. Optional: Transaction Type Management with DB2
CRUD operations for transaction type reference data stored in DB2 tables.

**Programs:** COTRTLIC, COTRTUPC, COBTUPDT

### 4. Optional: Account Extractions via MQ and VSAM
Asynchronous account and date inquiry through MQ messaging.

**Programs:** COACCT01, CODATE01

---

## Online Transactions (CICS)

| Transaction ID | Program | BMS Map | Function |
|:---------------|:--------|:--------|:---------|
| CC00 | COSGN00C | COSGN00 | Sign-on Screen |
| CM00 | COMEN01C | COMEN01 | Main Menu |
| CAVW | COACTVWC | COACTVW | Account View |
| CAUP | COACTUPC | COACTUP | Account Update |
| CCLI | COCRDLIC | COCRDLI | Credit Card List |
| CCDL | COCRDSLC | COCRDSL | Credit Card Detail View |
| CCUP | COCRDUPC | COCRDUP | Credit Card Update |
| CT00 | COTRN00C | COTRN00 | Transaction List |
| CT01 | COTRN01C | COTRN01 | Transaction View |
| CT02 | COTRN02C | COTRN02 | Transaction Add |
| CR00 | CORPT00C | CORPT00 | Transaction Report |
| CB00 | COBIL00C | COBIL00 | Bill Payment |
| CA00 | COADM01C | COADM01 | Admin Menu |
| CU00 | COUSR00C | COUSR00 | List Users |
| CU01 | COUSR01C | COUSR01 | Add User |
| CU02 | COUSR02C | COUSR02 | Update User |
| CU03 | COUSR03C | COUSR03 | Delete User |
| CPVS | COPAUS0C | COPAU00 | Pending Auth Summary *(optional)* |
| CPVD | COPAUS1C | COPAU01 | Pending Auth Details *(optional)* |
| CP00 | COPAUA0C | — | Process Auth Requests *(optional)* |
| CTTU | COTRTUPC | COTRTUP | Tran Type Add/Edit *(optional)* |
| CTLI | COTRTLIC | COTRTLI | Tran Type List/Delete *(optional)* |
| CDRD | CODATE01 | — | System Date Inquiry via MQ *(optional)* |
| CDRA | COACCT01 | — | Account Details via MQ *(optional)* |

---

## Data Files (VSAM)

| File Name | Type | Copybook | Description |
|:----------|:-----|:---------|:------------|
| USRSEC | KSDS | CSUSR01Y | User Security Records |
| ACCTDAT | KSDS | CVACT01Y | Account Master Data |
| CARDDAT | KSDS | CVACT02Y | Card Master Data |
| CUSTDAT | KSDS | CVCUS01Y | Customer Master Data |
| XREFDAT | KSDS | CVACT03Y | Account-Card-Customer Cross Reference |
| TRANSACT | KSDS+AIX | CVTRA05Y | Online Transaction Data |
| DALYTRAN | PS→KSDS | CVTRA06Y | Daily Transactions (for batch posting) |
| DISCGRP | KSDS | CVTRA02Y | Disclosure Group Reference |
| TCATBALF | KSDS | CVTRA01Y | Transaction Category Balance |
| TRANCATG | KSDS | CVTRA04Y | Transaction Category Types |
| TRANTYPE | KSDS | CVTRA03Y | Transaction Types |

---

## Batch Jobs

| Job | Program | Purpose |
|:----|:--------|:--------|
| POSTTRAN | CBTRN02C | Core daily transaction posting |
| INTCALC | CBACT04C | Interest calculation |
| CREASTMT | CBSTM03A | Statement generation |
| TRANREPT | CBTRN03C | Transaction report generation |
| COMBTRAN | SORT | Combine transaction files |
| WAITSTEP | COBSWAIT | Wait/delay step |
| CBPAUP0J | CBPAUP0C | Purge expired authorizations *(optional)* |
| MNTTRDB2 | COBTUPDT | Maintain transaction type table *(optional)* |

---

## Related Documentation

- [Master Navigation (README)](./README.md)
- [System Architecture](./architecture/system-overview.md)
- [Program Structure Reference](./reference/program-structure.md)
- [Business Logic](./behavior/business-logic.md)
- [Technical Debt Report](./technical-debt-report.md)
- [Code Metrics](./analysis/code-metrics.md)
- [Migration Guide](./migration/component-order.md)
