|
| 1 | +--- |
| 2 | +applyTo: "**/*.cob" |
| 3 | +--- |
| 4 | + |
| 5 | +# COBOL Comprehension Instructions |
| 6 | + |
| 7 | +When analyzing COBOL code in this workspace, use these instructions to understand its structure, business logic, and data flow. |
| 8 | + |
| 9 | +## COBOL Structure |
| 10 | +- **IDENTIFICATION DIVISION**: Program metadata (PROGRAM-ID) |
| 11 | +- **DATA DIVISION**: Variable declarations in WORKING-STORAGE and LINKAGE sections |
| 12 | +- **PROCEDURE DIVISION**: Business logic and program flow |
| 13 | + |
| 14 | +## Key Patterns to Identify |
| 15 | +1. **Data definitions**: PIC clauses define data types (9 = numeric, X = alphanumeric, V = decimal point) |
| 16 | +2. **Program calls**: CALL statements indicate inter-program communication |
| 17 | +3. **Control flow**: PERFORM, EVALUATE, IF/ELSE structures |
| 18 | +4. **Data operations**: MOVE, ADD, SUBTRACT, MULTIPLY, DIVIDE |
| 19 | + |
| 20 | +## Analysis Approach |
| 21 | +When asked to explain COBOL code: |
| 22 | +1. Identify the program's purpose from PROGRAM-ID and overall structure |
| 23 | +2. Document all data elements and their constraints |
| 24 | +3. Trace the business logic in PROCEDURE DIVISION |
| 25 | +4. Note any inter-program dependencies (CALL statements) |
| 26 | +5. Identify business rules embedded in conditional logic |
| 27 | + |
| 28 | +## Output for SpecOps |
| 29 | +When extracting specifications from COBOL, produce plain-language descriptions that: |
| 30 | +- A non-programmer domain expert could verify |
| 31 | +- Capture business rules, not implementation details |
| 32 | +- Document edge cases and error handling |
| 33 | +- Note any implicit assumptions in the code |
0 commit comments