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/THE…

, line.strip()):\n count += 1\n return count\n \n def _count_pattern(self, pattern: str) -> int:\n \"\"\"Count occurrences of a regex pattern.\"\"\"\n count = 0\n for line in self.lines:\n if re.search(pattern, line, re.IGNORECASE):\n count += 1\n return count\n \n def _calculate_score(self, metrics: Dict[str, int]) -> int:\n \"\"\"Calculate overall complexity score.\"\"\"\n score = 0\n \n # Base score from lines of code\n score += metrics['total_lines'] / self.WEIGHTS['loc_per_point']\n \n # Add weighted factors\n score += metrics['paragraphs'] * self.WEIGHTS['paragraph_weight']\n score += metrics['calls'] * self.WEIGHTS['call_weight']\n score += metrics['files'] * self.WEIGHTS['file_weight']\n score += metrics['sql_statements'] * self.WEIGHTS['sql_weight']\n score += metrics['goto_statements'] * self.WEIGHTS['goto_weight']\n score += metrics['alter_statements'] * self.WEIGHTS['alter_weight']\n score += metrics['perform_varying'] * self.WEIGHTS['perform_varying_weight']\n \n return int(score)\n \n def _get_complexity_level(self, score: int) -> str:\n \"\"\"Categorize complexity level.\"\"\"\n if score \u003c 20:\n return 'Simple'\n elif score \u003c 50:\n return 'Moderate'\n elif score \u003c 100:\n return 'Complex'\n else:\n return 'Very Complex'\n \n def _estimate_effort(self, score: int) -> float:\n \"\"\"Estimate effort in person-days.\"\"\"\n # Rough estimate: 1 point = 0.5 days\n # This should be calibrated based on team experience\n base_days = score * 0.5\n \n # Add overhead for testing and documentation (30%)\n return round(base_days * 1.3, 1)\n \n def _identify_risks(self, metrics: Dict[str, int]) -> list:\n \"\"\"Identify risk factors.\"\"\"\n risks = []\n \n if metrics['goto_statements'] > 0:\n risks.append({\n 'type': 'control_flow',\n 'description': f\"Contains {metrics['goto_statements']} GO TO statements - requires refactoring\",\n 'severity': 'high'\n })\n \n if metrics['alter_statements'] > 0:\n risks.append({\n 'type': 'control_flow',\n 'description': f\"Contains {metrics['alter_statements']} ALTER statements - complex refactoring needed\",\n 'severity': 'critical'\n })\n \n if metrics['sql_statements'] > 10:\n risks.append({\n 'type': 'database',\n 'description': f\"High number of SQL operations ({metrics['sql_statements']}) - requires careful transaction design\",\n 'severity': 'medium'\n })\n \n if metrics['calls'] > 5:\n risks.append({\n 'type': 'dependencies',\n 'description': f\"Calls {metrics['calls']} external programs - coordinate migration with dependencies\",\n 'severity': 'medium'\n })\n \n if metrics['total_lines'] > 1000:\n risks.append({\n 'type': 'size',\n 'description': f\"Large program ({metrics['total_lines']} lines) - consider splitting into multiple services\",\n 'severity': 'medium'\n })\n \n if metrics['files'] > 5:\n risks.append({\n 'type': 'io',\n 'description': f\"Accesses {metrics['files']} files - design appropriate data access layer\",\n 'severity': 'low'\n })\n \n return risks\n\n\ndef main():\n parser = argparse.ArgumentParser(description='Estimate COBOL program migration complexity')\n parser.add_argument('cobol_file', type=Path, help='Path to COBOL source file')\n parser.add_argument('--detailed', action='store_true', help='Show detailed metrics')\n parser.add_argument('--json', action='store_true', help='Output as JSON')\n \n args = parser.parse_args()\n \n if not args.cobol_file.exists():\n print(f\"Error: File not found: {args.cobol_file}\")\n return 1\n \n estimator = ComplexityEstimator(args.cobol_file)\n result = estimator.estimate()\n \n if args.json:\n print(json.dumps(result, indent=2))\n else:\n print(f\"\\nComplexity Analysis: {result['program']}\")\n print(\"=\" * 60)\n print(f\"Complexity Level: {result['complexity_level']}\")\n print(f\"Complexity Score: {result['complexity_score']}\")\n print(f\"Estimated Effort: {result['estimated_effort_days']} person-days\")\n \n if args.detailed:\n print(\"\\nDetailed Metrics:\")\n print(\"-\" * 60)\n for key, value in result['metrics'].items():\n print(f\" {key.replace('_', ' ').title()}: {value}\")\n \n if result['risk_factors']:\n print(\"\\nRisk Factors:\")\n print(\"-\" * 60)\n for risk in result['risk_factors']:\n severity_marker = {\n 'critical': '🔴',\n 'high': '🟠',\n 'medium': '🟡',\n 'low': '🟢'\n }.get(risk['severity'], '⚪')\n print(f\" {severity_marker} [{risk['severity'].upper()}] {risk['description']}\")\n else:\n print(\"\\n✅ No significant risk factors identified\")\n \n print()\n \n return 0\n\n\nif __name__ == '__main__':\n exit(main())\n","content_type":"text/x-python; charset=utf-8","language":"python","size":8386,"content_sha256":"047a5fe4e7134b58d6f5ef1b29a7105d509b1a64ac93ebf06e89a1488505a976"},{"filename":"scripts/extract-structure.py","content":"#!/usr/bin/env python3\n\"\"\"\nExtract structure from COBOL source files.\n\nThis script analyzes COBOL source code and extracts:\n- Division structure\n- Working-Storage variables\n- File definitions\n- Paragraph/Section structure\n- CALL statements\n- Program dependencies\n\"\"\"\n\nimport argparse\nimport json\nimport re\nfrom pathlib import Path\nfrom typing import Dict, List, Any\n\n\nclass COBOLStructureExtractor:\n \"\"\"Extract structural information from COBOL programs.\"\"\"\n \n def __init__(self, source_file: Path):\n self.source_file = source_file\n self.content = source_file.read_text(encoding='utf-8', errors='ignore')\n self.lines = self.content.split('\\n')\n \n def extract(self) -> Dict[str, Any]:\n \"\"\"Extract all structural information.\"\"\"\n return {\n 'program_name': self.extract_program_name(),\n 'divisions': self.extract_divisions(),\n 'working_storage': self.extract_working_storage(),\n 'file_definitions': self.extract_file_definitions(),\n 'paragraphs': self.extract_paragraphs(),\n 'calls': self.extract_calls(),\n 'copybooks': self.extract_copybooks(),\n 'sql_operations': self.extract_sql_operations(),\n 'statistics': self.calculate_statistics()\n }\n \n def extract_program_name(self) -> str:\n \"\"\"Extract program name from PROGRAM-ID.\"\"\"\n for line in self.lines:\n match = re.search(r'PROGRAM-ID\\.\\s+(\\S+)', line, re.IGNORECASE)\n if match:\n return match.group(1).rstrip('.')\n return self.source_file.stem\n \n def extract_divisions(self) -> Dict[str, int]:\n \"\"\"Find line numbers where divisions start.\"\"\"\n divisions = {}\n for i, line in enumerate(self.lines):\n for div_name in ['IDENTIFICATION', 'ENVIRONMENT', 'DATA', 'PROCEDURE']:\n if re.search(rf'{div_name}\\s+DIVISION', line, re.IGNORECASE):\n divisions[div_name] = i + 1\n return divisions\n \n def extract_working_storage(self) -> List[Dict[str, Any]]:\n \"\"\"Extract Working-Storage variables.\"\"\"\n variables = []\n in_working_storage = False\n \n for line in self.lines:\n if re.search(r'WORKING-STORAGE\\s+SECTION', line, re.IGNORECASE):\n in_working_storage = True\n continue\n if re.search(r'(PROCEDURE\\s+DIVISION|LINKAGE\\s+SECTION)', line, re.IGNORECASE):\n in_working_storage = False\n \n if in_working_storage:\n match = re.match(r'\\s*(\\d{2})\\s+(\\S+)\\s+(.+)', line)\n if match:\n level, name, rest = match.groups()\n pic_match = re.search(r'PIC\\s+(\\S+)', rest, re.IGNORECASE)\n variables.append({\n 'level': int(level),\n 'name': name,\n 'picture': pic_match.group(1) if pic_match else None,\n 'line': self.lines.index(line) + 1\n })\n \n return variables\n \n def extract_file_definitions(self) -> List[Dict[str, str]]:\n \"\"\"Extract file definitions from SELECT statements.\"\"\"\n files = []\n for line in self.lines:\n match = re.search(r'SELECT\\s+(\\S+)\\s+ASSIGN', line, re.IGNORECASE)\n if match:\n files.append({\n 'name': match.group(1),\n 'line': self.lines.index(line) + 1\n })\n return files\n \n def extract_paragraphs(self) -> List[Dict[str, Any]]:\n \"\"\"Extract paragraph and section names.\"\"\"\n paragraphs = []\n for i, line in enumerate(self.lines):\n # Match paragraph names (word followed by period at start of line)\n match = re.match(r'^([A-Z0-9\\-]+)\\.\\s*

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/THE…

, line.strip())\n if match and i > 0:\n para_name = match.group(1)\n # Skip division names\n if para_name not in ['IDENTIFICATION', 'ENVIRONMENT', 'DATA', 'PROCEDURE']:\n paragraphs.append({\n 'name': para_name,\n 'line': i + 1,\n 'type': 'section' if 'SECTION' in para_name else 'paragraph'\n })\n return paragraphs\n \n def extract_calls(self) -> List[Dict[str, Any]]:\n \"\"\"Extract CALL statements to other programs.\"\"\"\n calls = []\n for i, line in enumerate(self.lines):\n match = re.search(r'CALL\\s+[\\'\"](\\S+)[\\'\"]', line, re.IGNORECASE)\n if match:\n calls.append({\n 'program': match.group(1),\n 'line': i + 1\n })\n return calls\n \n def extract_copybooks(self) -> List[Dict[str, Any]]:\n \"\"\"Extract COPY statements.\"\"\"\n copybooks = []\n for i, line in enumerate(self.lines):\n match = re.search(r'COPY\\s+(\\S+)', line, re.IGNORECASE)\n if match:\n copybooks.append({\n 'name': match.group(1).rstrip('.'),\n 'line': i + 1\n })\n return copybooks\n \n def extract_sql_operations(self) -> List[Dict[str, Any]]:\n \"\"\"Extract embedded SQL operations.\"\"\"\n sql_ops = []\n in_sql = False\n sql_text = []\n sql_start = 0\n \n for i, line in enumerate(self.lines):\n if 'EXEC SQL' in line.upper():\n in_sql = True\n sql_start = i + 1\n sql_text = []\n \n if in_sql:\n sql_text.append(line.strip())\n \n if 'END-EXEC' in line.upper() and in_sql:\n in_sql = False\n sql_ops.append({\n 'statement': ' '.join(sql_text),\n 'line': sql_start\n })\n \n return sql_ops\n \n def calculate_statistics(self) -> Dict[str, int]:\n \"\"\"Calculate basic statistics.\"\"\"\n return {\n 'total_lines': len(self.lines),\n 'working_storage_vars': len(self.extract_working_storage()),\n 'paragraphs': len(self.extract_paragraphs()),\n 'calls': len(self.extract_calls()),\n 'copybooks': len(self.extract_copybooks()),\n 'sql_operations': len(self.extract_sql_operations())\n }\n\n\ndef main():\n parser = argparse.ArgumentParser(description='Extract structure from COBOL source files')\n parser.add_argument('cobol_file', type=Path, help='Path to COBOL source file')\n parser.add_argument('--output', '-o', type=Path, help='Output JSON file (default: stdout)')\n \n args = parser.parse_args()\n \n if not args.cobol_file.exists():\n print(f\"Error: File not found: {args.cobol_file}\")\n return 1\n \n extractor = COBOLStructureExtractor(args.cobol_file)\n structure = extractor.extract()\n \n output_json = json.dumps(structure, indent=2)\n \n if args.output:\n args.output.write_text(output_json)\n print(f\"Structure written to {args.output}\")\n else:\n print(output_json)\n \n return 0\n\n\nif __name__ == '__main__':\n exit(main())\n","content_type":"text/x-python; charset=utf-8","language":"python","size":7272,"content_sha256":"e67e3efde19a342cf1127adbce4b6378e643d776e0c94d6777f6d13a880499bf"},{"filename":"scripts/generate-java-classes.py","content":"#!/usr/bin/env python3\n\"\"\"\nGenerate Java POJO classes from COBOL copybooks.\n\nThis script parses COBOL copybook structures and generates corresponding\nJava classes with appropriate data types, getters, setters, and validation.\n\"\"\"\n\nimport argparse\nimport re\nfrom pathlib import Path\nfrom typing import List, Dict, Optional, Tuple\n\n\nclass FieldDefinition:\n \"\"\"Represents a COBOL field definition.\"\"\"\n \n def __init__(self, level: int, name: str, picture: Optional[str], occurs: Optional[int] = None):\n self.level = level\n self.name = name\n self.picture = picture\n self.occurs = occurs\n self.children: List[FieldDefinition] = []\n \n def is_group(self) -> bool:\n \"\"\"Check if this is a group item (no picture clause).\"\"\"\n return self.picture is None\n \n def to_java_type(self) -> str:\n \"\"\"Convert COBOL picture to Java type.\"\"\"\n if self.picture is None:\n # Group item - will be a nested class\n return self.to_java_class_name()\n \n pic = self.picture.upper()\n \n # Numeric types\n if re.match(r'^S?9+V?9*

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/THE…

, pic.replace('(', '').replace(')', '')):\n if 'V' in pic or 'COMP-3' in pic:\n return 'BigDecimal'\n digit_count = pic.count('9')\n if digit_count \u003c= 9:\n return 'int' if pic.startswith('S') or pic.startswith('9') else 'long'\n elif digit_count \u003c= 18:\n return 'long'\n else:\n return 'BigInteger'\n \n # Alphanumeric\n if pic.startswith('X'):\n return 'String'\n \n # Default to String for unknown patterns\n return 'String'\n \n def to_java_field_name(self) -> str:\n \"\"\"Convert COBOL name to Java field name (camelCase).\"\"\"\n parts = self.name.lower().replace('_', '-').split('-')\n return parts[0] + ''.join(p.capitalize() for p in parts[1:])\n \n def to_java_class_name(self) -> str:\n \"\"\"Convert COBOL name to Java class name (PascalCase).\"\"\"\n parts = self.name.lower().replace('_', '-').split('-')\n return ''.join(p.capitalize() for p in parts)\n\n\nclass CopybookParser:\n \"\"\"Parse COBOL copybook and extract field definitions.\"\"\"\n \n def __init__(self, copybook_file: Path):\n self.copybook_file = copybook_file\n self.content = copybook_file.read_text(encoding='utf-8', errors='ignore')\n self.lines = self.content.split('\\n')\n \n def parse(self) -> FieldDefinition:\n \"\"\"Parse copybook and return root field definition.\"\"\"\n fields = []\n \n for line in self.lines:\n # Match COBOL field definition: level number, name, and optional picture\n match = re.match(r'\\s*(\\d{2})\\s+(\\S+)(?:\\s+PIC\\s+(\\S+))?(?:\\s+OCCURS\\s+(\\d+))?', line, re.IGNORECASE)\n if match:\n level = int(match.group(1))\n name = match.group(2).rstrip('.')\n picture = match.group(3)\n occurs = int(match.group(4)) if match.group(4) else None\n \n field = FieldDefinition(level, name, picture, occurs)\n fields.append(field)\n \n # Build hierarchy\n return self._build_hierarchy(fields)\n \n def _build_hierarchy(self, fields: List[FieldDefinition]) -> FieldDefinition:\n \"\"\"Build hierarchical structure from flat field list.\"\"\"\n if not fields:\n return FieldDefinition(1, 'Root', None)\n \n root = fields[0]\n stack = [root]\n \n for field in fields[1:]:\n # Pop stack until we find the parent level\n while stack and stack[-1].level >= field.level:\n stack.pop()\n \n if stack:\n stack[-1].children.append(field)\n \n stack.append(field)\n \n return root\n\n\nclass JavaClassGenerator:\n \"\"\"Generate Java class from COBOL copybook structure.\"\"\"\n \n def __init__(self, root_field: FieldDefinition, package_name: str = 'com.example.model'):\n self.root = root_field\n self.package_name = package_name\n self.imports = set()\n \n def generate(self) -> str:\n \"\"\"Generate complete Java class.\"\"\"\n self._collect_imports(self.root)\n \n lines = []\n lines.append(f'package {self.package_name};')\n lines.append('')\n \n # Add imports\n if self.imports:\n for imp in sorted(self.imports):\n lines.append(f'import {imp};')\n lines.append('')\n \n # Generate class\n lines.append('/**')\n lines.append(f' * Generated from COBOL copybook: {self.root.name}')\n lines.append(' * Auto-generated - do not modify directly')\n lines.append(' */')\n lines.extend(self._generate_class(self.root, 0))\n \n return '\\n'.join(lines)\n \n def _collect_imports(self, field: FieldDefinition):\n \"\"\"Collect required imports.\"\"\"\n java_type = field.to_java_type()\n \n if java_type == 'BigDecimal':\n self.imports.add('java.math.BigDecimal')\n elif java_type == 'BigInteger':\n self.imports.add('java.math.BigInteger')\n elif field.occurs:\n self.imports.add('java.util.List')\n self.imports.add('java.util.ArrayList')\n \n for child in field.children:\n self._collect_imports(child)\n \n def _generate_class(self, field: FieldDefinition, indent_level: int) -> List[str]:\n \"\"\"Generate class definition recursively.\"\"\"\n lines = []\n indent = ' ' * indent_level\n \n class_name = field.to_java_class_name()\n \n lines.append(f'{indent}public class {class_name} {{')\n \n # Generate fields\n for child in field.children:\n field_indent = ' ' * (indent_level + 1)\n java_type = child.to_java_type()\n field_name = child.to_java_field_name()\n \n if child.occurs:\n lines.append(f'{field_indent}private List\u003c{java_type}> {field_name} = new ArrayList\u003c>();')\n else:\n lines.append(f'{field_indent}private {java_type} {field_name};')\n \n if field.children:\n lines.append('')\n \n # Generate getters and setters\n for child in field.children:\n field_indent = ' ' * (indent_level + 1)\n java_type = child.to_java_type()\n field_name = child.to_java_field_name()\n method_suffix = field_name[0].upper() + field_name[1:]\n \n if child.occurs:\n return_type = f'List\u003c{java_type}>'\n lines.append(f'{field_indent}public {return_type} get{method_suffix}() {{')\n lines.append(f'{field_indent} return {field_name};')\n lines.append(f'{field_indent}}}')\n lines.append('')\n lines.append(f'{field_indent}public void set{method_suffix}({return_type} {field_name}) {{')\n lines.append(f'{field_indent} this.{field_name} = {field_name};')\n lines.append(f'{field_indent}}}')\n else:\n lines.append(f'{field_indent}public {java_type} get{method_suffix}() {{')\n lines.append(f'{field_indent} return {field_name};')\n lines.append(f'{field_indent}}}')\n lines.append('')\n lines.append(f'{field_indent}public void set{method_suffix}({java_type} {field_name}) {{')\n lines.append(f'{field_indent} this.{field_name} = {field_name};')\n lines.append(f'{field_indent}}}')\n lines.append('')\n \n # Generate nested classes for group items\n for child in field.children:\n if child.is_group() and child.children:\n lines.extend(self._generate_class(child, indent_level + 1))\n lines.append('')\n \n lines.append(f'{indent}}}')\n \n return lines\n\n\ndef main():\n parser = argparse.ArgumentParser(description='Generate Java classes from COBOL copybooks')\n parser.add_argument('copybook', type=Path, help='Path to COBOL copybook file')\n parser.add_argument('--package', '-p', default='com.example.model', help='Java package name')\n parser.add_argument('--output-dir', '-o', type=Path, help='Output directory for Java files')\n \n args = parser.parse_args()\n \n if not args.copybook.exists():\n print(f\"Error: Copybook not found: {args.copybook}\")\n return 1\n \n # Parse copybook\n parser_obj = CopybookParser(args.copybook)\n root_field = parser_obj.parse()\n \n # Generate Java class\n generator = JavaClassGenerator(root_field, args.package)\n java_code = generator.generate()\n \n # Write output\n if args.output_dir:\n args.output_dir.mkdir(parents=True, exist_ok=True)\n # Convert package name to path (e.g., com.example.model -> com/example/model)\n package_parts = args.package.split('.')\n package_path = args.output_dir.joinpath(*package_parts)\n package_path.mkdir(parents=True, exist_ok=True)\n \n output_file = package_path / f'{root_field.to_java_class_name()}.java'\n output_file.write_text(java_code)\n print(f\"Generated: {output_file}\")\n else:\n print(java_code)\n \n return 0\n\n\nif __name__ == '__main__':\n exit(main())\n","content_type":"text/x-python; charset=utf-8","language":"python","size":9537,"content_sha256":"6f12989b67f63ff087f7c76ec5e1d8b3481bca839290e4cde163dd65c10ab33d"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"COBOL Migration Analyzer","type":"text"}]},{"type":"paragraph","content":[{"text":"Analyze legacy COBOL programs and JCL scripts for migration to Java. Extract business logic, data structures, and dependencies to generate actionable migration strategies.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Capabilities","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"1. COBOL Program Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"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.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. JCL Job Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"Parse JCL job steps, program invocations, data dependencies (DD statements), conditional logic (COND, IF/THEN/ELSE), return codes, and resource requirements.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. Copybook Processing","type":"text"}]},{"type":"paragraph","content":[{"text":"Extract record layouts with level numbers, REDEFINES clauses, group items, OCCURS clauses, and picture clauses. Generate Java POJOs from copybook structures.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. Dependency Mapping","type":"text"}]},{"type":"paragraph","content":[{"text":"Build complete dependency graphs showing CALL hierarchies, copybook usage, file dependencies, database table access, and shared utility references across the codebase.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Workflow","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 1: Discover COBOL Assets","type":"text"}]},{"type":"paragraph","content":[{"text":"Find COBOL programs, JCL jobs, and copybooks:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"find . -name \"*.cbl\" -o -name \"*.CBL\" -o -name \"*.cob\"\nfind . -name \"*.jcl\" -o -name \"*.JCL\"\nfind . -name \"*.cpy\" -o -name \"*.CPY\"","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"scripts/analyze-dependencies.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"scripts/analyze-dependencies.ps1","type":"text","marks":[{"type":"code_inline"}]},{"text":" to generate dependency graph.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2: Extract Structure","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"scripts/extract-structure.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" to parse COBOL programs and extract divisions, variables, paragraphs, and dependencies in JSON format.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 3: Generate Java Code","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"scripts/generate-java-classes.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" to convert copybooks to Java POJOs with appropriate data types and Bean Validation annotations.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 4: Estimate Complexity","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"scripts/estimate-complexity.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" to calculate migration complexity based on LOC, external calls, file operations, SQL statements, and control flow.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 5: Create Migration Strategy","type":"text"}]},{"type":"paragraph","content":[{"text":"Document program overview, dependencies, data structures, business logic patterns, proposed Java design, migration estimate, and action items.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Reference","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"COBOL to Java Type Mapping","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"COBOL Picture","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Java Type","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Notes","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC 9(n)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"int","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"long","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"BigInteger","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Unsigned numeric","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC S9(n)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"int","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"long","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"BigInteger","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Signed numeric","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC 9(n)V9(m)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BigDecimal","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Unsigned decimal","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC S9(n)V9(m)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BigDecimal","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Signed decimal","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC S9(n)V9(m) COMP-3","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BigDecimal","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Packed decimal - critical precision!","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC S9(n) COMP","type":"text","marks":[{"type":"code_inline"}]},{"text":" / ","type":"text"},{"text":"BINARY","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"int","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"long","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Binary storage","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC S9(n) COMP-1","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"float","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Single precision (avoid for financial)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC S9(n) COMP-2","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"double","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Double precision (avoid for financial)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC X(n)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"String","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Alphanumeric/character","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC A(n)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"String","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Alphabetic only","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PIC N(n)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"String","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"National/Unicode","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"OCCURS n","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"List\u003cT>","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"T[]","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fixed arrays/tables","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"OCCURS n DEPENDING ON","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"List\u003cT>","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Variable-length arrays","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"88 level","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"enum","type":"text","marks":[{"type":"code_inline"}]},{"text":" or constants","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Condition names","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"INDEX","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"int","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Table index (1-based in COBOL)","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Common Pattern Conversions","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"File I/O","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"READ...AT END","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"BufferedReader","type":"text","marks":[{"type":"code_inline"}]},{"text":" with try-with-resources or NIO streams","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"File updates","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"REWRITE","type":"text","marks":[{"type":"code_inline"}]},{"text":" → Update operations in DB or file systems","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Table lookup","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"SEARCH","type":"text","marks":[{"type":"code_inline"}]},{"text":" → Linear search with streams","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Binary search","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"SEARCH ALL","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"Collections.binarySearch()","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"stream().filter().findFirst()","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"String operations","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"STRING/UNSTRING","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"StringBuilder","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"String.split()","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Inspection","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"INSPECT","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"String.replace()","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"replaceAll()","type":"text","marks":[{"type":"code_inline"}]},{"text":", or regex","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CALL statements","type":"text","marks":[{"type":"strong"}]},{"text":": → Method calls or service invocations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"EVALUATE","type":"text","marks":[{"type":"strong"}]},{"text":": → ","type":"text"},{"text":"switch","type":"text","marks":[{"type":"code_inline"}]},{"text":" statement (Java 14+ with enhanced switch)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Date arithmetic","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"FUNCTION INTEGER-OF-DATE","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"LocalDate","type":"text","marks":[{"type":"code_inline"}]},{"text":" operations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ACCEPT DATE/TIME","type":"text","marks":[{"type":"strong"}]},{"text":": → ","type":"text"},{"text":"LocalDate.now()","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"LocalTime.now()","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Condition names (Level 88)","type":"text","marks":[{"type":"strong"}]},{"text":": → ","type":"text"},{"text":"enum","type":"text","marks":[{"type":"code_inline"}]},{"text":" or typed constants","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Computed GO TO","type":"text","marks":[{"type":"strong"}]},{"text":": → Strategy pattern or switch statement","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"REDEFINES","type":"text","marks":[{"type":"strong"}]},{"text":": → Union types, ByteBuffer views, or separate accessor classes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"COPY statements","type":"text","marks":[{"type":"strong"}]},{"text":": → Package imports or shared entity classes","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Example: Copybook to Java POJO","type":"text"}]},{"type":"paragraph","content":[{"text":"COBOL Copybook:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"cobol"},"content":[{"text":"01 EMPLOYEE-RECORD.\n 05 EMP-ID PIC 9(6).\n 05 EMP-NAME PIC X(30).\n 05 EMP-SALARY PIC S9(7)V99 COMP-3.","type":"text"}]},{"type":"paragraph","content":[{"text":"Generated Java:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"java"},"content":[{"text":"public class EmployeeRecord {\n private int empId;\n private String empName;\n private BigDecimal empSalary;\n // getters/setters\n}","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Migration Considerations","type":"text"}]},{"type":"paragraph","content":[{"text":"Critical Patterns:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ALWAYS","type":"text","marks":[{"type":"strong"}]},{"text":" use ","type":"text"},{"text":"BigDecimal","type":"text","marks":[{"type":"code_inline"}]},{"text":" for COMP-3 and numeric with decimals (never float/double)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preserve precision","type":"text","marks":[{"type":"strong"}]},{"text":": Use ","type":"text"},{"text":"BigDecimal","type":"text","marks":[{"type":"code_inline"}]},{"text":" with exact scale for financial calculations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"1-based indexing","type":"text","marks":[{"type":"strong"}]},{"text":": Document that COBOL arrays start at 1, Java at 0","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Implicit conversions","type":"text","marks":[{"type":"strong"}]},{"text":": Make COBOL's automatic numeric↔string conversions explicit","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"REDEFINES","type":"text","marks":[{"type":"strong"}]},{"text":": Model as union type, ByteBuffer overlay, or separate view classes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Computed GO TO","type":"text","marks":[{"type":"strong"}]},{"text":": Refactor to strategy pattern or switch statement","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ALTER statement","type":"text","marks":[{"type":"strong"}]},{"text":": Refactor to structured control flow (if/while/switch)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PERFORM THRU","type":"text","marks":[{"type":"strong"}]},{"text":": Map to single method containing full paragraph range","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"BY REFERENCE vs BY CONTENT","type":"text","marks":[{"type":"strong"}]},{"text":": Document parameter passing semantics","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test rigorously","type":"text","marks":[{"type":"strong"}]},{"text":": Validate with production data samples, especially for COMP-3","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Output Requirements:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Program overview and type classification","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Complete dependency graph (CALL tree, copybooks, files, DB tables)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Data structure mapping (copybooks → Java classes)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Business logic summary (key paragraphs → methods)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Proposed Java architecture (services, repositories, entities)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Migration effort estimate (complexity score, LOC, risk factors)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Prioritized action items","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Advanced Topics","type":"text"}]},{"type":"paragraph","content":[{"text":"For detailed conversion rules and patterns, see:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"pseudocode-cobol-rules.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/pseudocode-cobol-rules.md","title":null}},{"type":"strong"}]},{"text":" - Comprehensive COBOL to pseudocode conversion rules including data types, statements, file operations, string operations, table operations, program control, translation patterns, and common gotchas","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"pseudocode-common-rules.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/pseudocode-common-rules.md","title":null}},{"type":"strong"}]},{"text":" - Common pseudocode syntax and conventions applicable to all languages","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"transaction-handling.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/transaction-handling.md","title":null}},{"type":"strong"}]},{"text":" - Transaction management and rollback strategies for CICS/IMS to Java","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"messaging-integration.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/messaging-integration.md","title":null}},{"type":"strong"}]},{"text":" - Message queue and async patterns (MQ, CICS queues to JMS/Kafka)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"performance-patterns.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/performance-patterns.md","title":null}},{"type":"strong"}]},{"text":" - Batch processing optimization and memory management","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"testing-strategy.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/testing-strategy.md","title":null}},{"type":"strong"}]},{"text":" - Comprehensive testing including unit, integration, parallel validation, and data-driven testing","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Tools and Scripts","type":"text"}]},{"type":"paragraph","content":[{"text":"All scripts support cross-platform execution (Windows PowerShell, bash):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"analyze-dependencies.sh/ps1","type":"text","marks":[{"type":"code_inline"}]},{"text":" - Generate dependency graph","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"extract-structure.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" - Parse COBOL structure to JSON","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"generate-java-classes.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" - Convert copybooks to Java POJOs","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"estimate-complexity.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" - Calculate migration complexity score","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Scripts use standard libraries only and output JSON for easy integration with CI/CD pipelines.","type":"text"}]}]},"metadata":{"date":"2026-06-05","name":"cobol-migration-analyzer","author":"@skillopedia","source":{"stars":12,"repo_name":"hanoi-rainbow","origin_url":"https://github.com/dauquangthanh/hanoi-rainbow/blob/HEAD/skills/cobol-migration-analyzer/SKILL.md","repo_owner":"dauquangthanh","body_sha256":"c1a4f2003e9208cf72c43dde3e6ad4fb2aa4576d252958549b4d535cb27980f8","cluster_key":"73bc423b983799d79f809fc534a8cbb24baa778b372b04dfe279e11a1d67f5d0","clean_bundle":{"format":"clean-skill-bundle-v1","source":"dauquangthanh/hanoi-rainbow/skills/cobol-migration-analyzer/SKILL.md","attachments":[{"id":"d5720dae-bb03-52da-acd4-9b6f474dfc98","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d5720dae-bb03-52da-acd4-9b6f474dfc98/attachment.java","path":"assets/java-class-template.java","size":2345,"sha256":"1a5772f6d77e9267469ac2d9e6494508f0410e90607b1382293bd31b3da5c8c5","contentType":"text/x-java"},{"id":"0a31bac5-f371-5b83-a904-610869136e29","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0a31bac5-f371-5b83-a904-610869136e29/attachment.md","path":"assets/migration-report-template.md","size":5139,"sha256":"6180319b039770b32b0b49f15089ad23edaf3333d4cdd620fc5f6b51019eb509","contentType":"text/markdown; charset=utf-8"},{"id":"a129727c-670d-5391-960c-4caaf3d9e975","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a129727c-670d-5391-960c-4caaf3d9e975/attachment.md","path":"references/messaging-integration.md","size":11293,"sha256":"b752b762a4bd41e2980dcc091ea2af9de132133c5cf7d744afc33af652e319a8","contentType":"text/markdown; charset=utf-8"},{"id":"4fa1ff58-3079-5483-80ac-101e581edafa","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4fa1ff58-3079-5483-80ac-101e581edafa/attachment.md","path":"references/performance-patterns.md","size":5977,"sha256":"4cb164ccf8e5ad12a3c8fd850719341081e1f90791690bc314b4787224c68e19","contentType":"text/markdown; charset=utf-8"},{"id":"09e4f43e-9cd9-52f1-a7e6-ec22215fc746","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/09e4f43e-9cd9-52f1-a7e6-ec22215fc746/attachment.md","path":"references/pseudocode-cobol-rules.md","size":11750,"sha256":"2b2551483b0a9324009da2f7cafc2caa3fbec6cb060acbb7a5c40b06f3eb57a5","contentType":"text/markdown; charset=utf-8"},{"id":"a7dba86a-6fb4-523d-bdff-f386caae182f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a7dba86a-6fb4-523d-bdff-f386caae182f/attachment.md","path":"references/pseudocode-common-rules.md","size":2390,"sha256":"52d0b0985df105af530ce5571dbce6887d2e247f6c60ba3bb428827c66a5b215","contentType":"text/markdown; charset=utf-8"},{"id":"cdf26d5e-bc15-5b04-a748-1d6349ce4092","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cdf26d5e-bc15-5b04-a748-1d6349ce4092/attachment.md","path":"references/testing-strategy.md","size":13455,"sha256":"62662e5dbdfd6c4b090cf8c4508acc341bf8b2ee46a794b4a417ab126e0ed56a","contentType":"text/markdown; charset=utf-8"},{"id":"9053767c-6ce8-5ae1-b6d3-0c1c0d445179","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9053767c-6ce8-5ae1-b6d3-0c1c0d445179/attachment.md","path":"references/transaction-handling.md","size":11492,"sha256":"ce9c52a6862cfeea9928c239843d9d08a805efbb17a80930278063604d15ad80","contentType":"text/markdown; charset=utf-8"},{"id":"cf4a9383-51ea-5bbc-b8d0-66db82ef12a4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cf4a9383-51ea-5bbc-b8d0-66db82ef12a4/attachment.ps1","path":"scripts/analyze-dependencies.ps1","size":5197,"sha256":"6a3e37c94339b0f59cd594ec4c1e6ea01ef581302e813fe611dab53a31f6fe9c","contentType":"text/plain; charset=utf-8"},{"id":"3747cd89-9187-5a90-aeae-7f2fd7b24c10","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3747cd89-9187-5a90-aeae-7f2fd7b24c10/attachment.sh","path":"scripts/analyze-dependencies.sh","size":5211,"sha256":"eed61e6bc2f782f449faa942b2d5aa3ffa1b946be083c7b2ac058677bddfeb38","contentType":"application/x-sh; charset=utf-8"},{"id":"2add485a-d3d4-5247-bb65-3ea9799bd052","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/2add485a-d3d4-5247-bb65-3ea9799bd052/attachment.py","path":"scripts/estimate-complexity.py","size":8386,"sha256":"047a5fe4e7134b58d6f5ef1b29a7105d509b1a64ac93ebf06e89a1488505a976","contentType":"text/x-python; charset=utf-8"},{"id":"356e5e14-5cae-5e59-ad79-e6778091b873","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/356e5e14-5cae-5e59-ad79-e6778091b873/attachment.py","path":"scripts/extract-structure.py","size":7272,"sha256":"e67e3efde19a342cf1127adbce4b6378e643d776e0c94d6777f6d13a880499bf","contentType":"text/x-python; charset=utf-8"},{"id":"94f4979a-25ac-54b5-a19a-4703562222d9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/94f4979a-25ac-54b5-a19a-4703562222d9/attachment.py","path":"scripts/generate-java-classes.py","size":9537,"sha256":"6f12989b67f63ff087f7c76ec5e1d8b3481bca839290e4cde163dd65c10ab33d","contentType":"text/x-python; charset=utf-8"}],"bundle_sha256":"1af4f8a135cf47c54525360b0d6c94d6d704a9ca4ec161d1ca4bc367d02462eb","attachment_count":13,"text_attachments":12,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":1,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/cobol-migration-analyzer/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"business-sales-marketing","category_label":"Business"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"business-sales-marketing","metadata":{"version":"1.0","category":"legacy-migration"},"import_tag":"clean-skills-v1","description":"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."}},"renderedAt":1782980685146}

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/THE…