cobol-migration-analyzer
БесплатноЗапускает вложенные скриптыНе проверенAnalyzes legacy COBOL programs and JCL jobs to assist with migration to modern Java applications. Extracts business logic, identifies dependencies, generates…
Об этом скилле
COBOL Migration Analyzer
Analyze legacy COBOL programs and JCL scripts for migration to Java. Extract business logic, data structures, and dependencies to generate actionable migration strategies.
Core Capabilities
1. COBOL Program Analysis
Extract COBOL divisions (IDENTIFICATION, ENVIRONMENT, DATA, PROCEDURE), Working-Storage variables, file definitions (FD), business logic paragraphs, PERFORM statements, CALL hierarchies, embedded SQL, and error handling patterns.
2. JCL Job Analysis
Parse JCL job steps, program invocations, data dependencies (DD statements), conditional logic (COND, IF/THEN/ELSE), return codes, and resource requirements.
3. Copybook Processing
Extract record layouts with level numbers, REDEFINES clauses, group items, OCCURS clauses, and picture clauses. Generate Java POJOs from copybook structures.
4. Dependency Mapping
Build complete dependency graphs showing CALL hierarchies, copybook usage, file dependencies, database table access, and shared utility references across the codebase.
Workflow
Step 1: Discover COBOL Assets
Find COBOL programs, JCL jobs, and copybooks:
find . -name "*.cbl" -o -name "*.CBL" -o -name "*.cob"
find . -name "*.jcl" -o -name "*.JCL"
find . -name "*.cpy" -o -name "*.CPY"
Use scripts/analyze-dependencies.sh or scripts/analyze-dependencies.ps1 to generate dependency graph.
Step 2: Extract Structure
Use scripts/extract-structure.py to parse COBOL programs and extract divisions, variables, paragraphs, and dependencies in JSON format.
Step 3: Generate Java Code
Use scripts/generate-java-classes.py to convert copybooks to Java POJOs with appropriate data types and Bean Validation annotations.
Step 4: Estimate Complexity
Use scripts/estimate-complexity.py to calculate migration complexity based on LOC, external calls, file operations, SQL statements, and control flow.
Step 5: Create Migration Strategy
Document program overview, dependencies, data structures, business logic patterns, proposed Java design, migration estimate, and action items.
Quick Reference
COBOL to Java Type Mapping
| COBOL Picture | Java Type | Notes |
|---|---|---|
PIC 9(n) |
int, long, BigInteger |
Unsigned numeric |
PIC S9(n) |
int, long, BigInteger |
Signed numeric |
PIC 9(n)V9(m) |
BigDecimal |
Unsigned decimal |
PIC S9(n)V9(m) |
BigDecimal |
Signed decimal |
PIC S9(n)V9(m) COMP-3 |
BigDecimal |
Packed decimal - critical precision! |
PIC S9(n) COMP / BINARY |
int, long |
Binary storage |
PIC S9(n) COMP-1 |
float |
Single precision (avoid for financial) |
PIC S9(n) COMP-2 |
double |
Double precision (avoid for financial) |
PIC X(n) |
String |
Alphanumeric/character |
PIC A(n) |
String |
Alphabetic only |
PIC N(n) |
String |
National/Unicode |
OCCURS n |
List<T> or T[] |
Fixed arrays/tables |
OCCURS n DEPENDING ON |
List<T> |
Variable-length arrays |
88 level |
enum or constants |
Condition names |
INDEX |
int |
Table index (1-based in COBOL) |
Common Pattern Conversions
- File I/O:
READ...AT END→BufferedReaderwith try-with-resources or NIO streams - File updates:
REWRITE→ Update operations in DB or file systems - Table lookup:
SEARCH→ Linear search with streams - Binary search:
SEARCH ALL→Collections.binarySearch()orstream().filter().findFirst() - String operations:
STRING/UNSTRING→StringBuilderorString.split() - Inspection:
INSPECT→String.replace(),replaceAll(), or regex - CALL statements: → Method calls or service invocations
- EVALUATE: →
switchstatement (Java 14+ with enhanced switch) - Date arithmetic:
FUNCTION INTEGER-OF-DATE→LocalDateoperations - ACCEPT DATE/TIME: →
LocalDate.now(),LocalTime.now() - Condition names (Level 88): →
enumor typed constants - Computed GO TO: → Strategy pattern or switch statement
- REDEFINES: → Union types, ByteBuffer views, or separate accessor classes
- COPY statements: → Package imports or shared entity classes
Example: Copybook to Java POJO
COBOL Copybook:
01 EMPLOYEE-RECORD.
05 EMP-ID PIC 9(6).
05 EMP-NAME PIC X(30).
05 EMP-SALARY PIC S9(7)V99 COMP-3.
Generated Java:
public class EmployeeRecord {
private int empId;
private String empName;
private BigDecimal empSalary;
// getters/setters
}
Migration Considerations
Critical Patterns:
- ALWAYS use
BigDecimalfor COMP-3 and numeric with decimals (never float/double) - Preserve precision: Use
BigDecimalwith exact scale for financial calculations - 1-based indexing: Document that COBOL arrays start at 1, Java at 0
- Implicit conversions: Make COBOL's automatic numeric↔string conversions explicit
- REDEFINES: Model as union type, ByteBuff
Установить cobol-migration-analyzer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cobol-migration-analyzer?
Analyzes legacy COBOL programs and JCL jobs to assist with migration to modern Java applications. Extracts business logic, identifies dependencies, generates migration reports, and creates Java implementation strategies. Use when working with mainframe migration, COBOL analysis, legacy system modernization, JCL workflows, or when users mention COBOL to Java conversion, analyzing .cbl/.CBL/.cob files, working with copybooks, or planning Java service implementations from COBOL programs.
Как установить скилл cobol-migration-analyzer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cobol-migration-analyzer запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic