# Component Migration Order

> [← Back to README](../README.md) | [Test Specifications →](./test-specifications.md)

## Migration Wave Strategy

Based on dependency analysis, components should be migrated in the following order to minimize risk and manage coupling.

### Wave 1: Independent Utilities and Data Layer
**Components with minimal dependencies — can be migrated independently:**

| Component | Type | Dependencies | Rationale |
|:----------|:-----|:-------------|:----------|
| CSUTLDTC | Utility | None | Self-contained date utility |
| COBSWAIT | Utility | ASM (MVSWAIT) | Simple wait wrapper |
| CSUSR01Y | Copybook | None | User security record definition |
| CVACT01Y-03Y | Copybooks | None | Core data record definitions |
| CVCUS01Y | Copybook | None | Customer record definition |
| CVTRA01Y-07Y | Copybooks | None | Transaction data definitions |
| VSAM file structures | Data | Copybooks | Data layer (schema equivalent) |

### Wave 2: Batch Data Load Programs
**File load utilities — depend only on data copybooks:**

| Component | Dependencies | Rationale |
|:----------|:-------------|:----------|
| CBACT01C | CVACT01Y, CODATECN | Account file load |
| CBACT02C | CVACT02Y | Card file load |
| CBACT03C | CVACT03Y | Cross-reference load |
| CBCUS01C | CVCUS01Y | Customer file load |

### Wave 3: Core Batch Processing
**Business logic batch programs — depend on data layer + Wave 2:**

| Component | Dependencies | Rationale |
|:----------|:-------------|:----------|
| CBTRN01C | CVTRA06Y, CVCUS01Y, CVACT03Y, CVACT02Y, CVACT01Y, CVTRA05Y | Transaction backup |
| CBTRN02C | CVTRA06Y, CVTRA05Y, CVACT03Y, CVACT01Y, CVTRA01Y | Core transaction posting |
| CBACT04C | CVTRA01Y, CVACT03Y, CVTRA02Y, CVACT01Y, CVTRA05Y | Interest calculation |
| CBTRN03C | CVTRA05Y, CVACT03Y, CVTRA03Y, CVTRA04Y, CVTRA07Y | Transaction reporting |
| CBSTM03A/B | COSTM01, CVACT03Y, CUSTREC, CVACT01Y | Statement generation |
| CBEXPORT | CVCUS01Y, CVACT01Y, CVACT03Y, CVTRA05Y, CVACT02Y, CVEXPORT | Data export |
| CBIMPORT | Same as CBEXPORT | Data import |

### Wave 4: Online Authentication and Menus
**Entry points — depend on shared copybooks:**

| Component | Dependencies | Rationale |
|:----------|:-------------|:----------|
| COSGN00C | COCOM01Y, CSUSR01Y, DFHAID, DFHBMSCA, COSGN00 BMS | Authentication (entry point) |
| COMEN01C | COCOM01Y, COMEN02Y, DFHAID, DFHBMSCA, COMEN01 BMS | Main menu |
| COADM01C | COCOM01Y, COADM02Y, DFHAID, DFHBMSCA, COADM01 BMS | Admin menu |

### Wave 5: Online CRUD Screens
**Business function screens — depend on Waves 1-4:**

| Component | Dependencies | Rationale |
|:----------|:-------------|:----------|
| COACTVWC | Account View — read-only, lower risk |
| COACTUPC | Account Update — highest complexity, most risk |
| COCRDLIC | Card List — pagination logic |
| COCRDSLC | Card Detail — read-only |
| COCRDUPC | Card Update — validation logic |
| COTRN00C-02C | Transaction screens |
| COBIL00C | Bill payment |
| CORPT00C | Report submission |
| COUSR00C-03C | User management (admin) |

### Wave 6: Optional Modules
**Migrate last due to additional technology dependencies:**

| Component | Additional Tech | Rationale |
|:----------|:---------------|:----------|
| COTRTLIC, COTRTUPC, COBTUPDT | DB2 | Transaction type management |
| COPAUA0C, COPAUS0C-2C, CBPAUP0C | IMS, DB2, MQ | Authorization processing |
| DBUNLDGS, PAUDBLOD, PAUDBUNL | IMS | IMS database utilities |
| COACCT01, CODATE01 | MQ | MQ-based inquiries |

---

## Tightly Coupled Components (Must Migrate Together)

1. **CBSTM03A + CBSTM03B** — Statement generation main + sub-program
2. **COCRDLIC + COCRDSLC + COCRDUPC** — Card management flow
3. **COUSR00C + COUSR01C + COUSR02C + COUSR03C** — User CRUD suite
4. **COTRN00C + COTRN01C + COTRN02C** — Transaction management suite
5. **COPAUS0C + COPAUS1C + COPAUS2C** — Authorization view suite

---

*See also: [Dependencies](../architecture/dependencies.md) | [Test Specifications](./test-specifications.md)*
