8c1f9114f6
- docs/cobol-statement-benchmark-plan.md — full coverage matrix and gap analysis - 34 P0 COBOL samples: arithmetic(9), move(5), file(6), control(6), inspect(3), search(2), perform(3) - test-data/validate_statements.py — automatic validation script - Validation: 34/34 samples pass preprocess + extract_structure
22 lines
676 B
COBOL
22 lines
676 B
COBOL
* ==== TYPE: ST-ADD-TO ====
|
|
* FEATURE: ADD x TO y (constant / variable)
|
|
* STATEMENT: ADD
|
|
* BRANCHES: 2, DECISIONS: 1
|
|
IDENTIFICATION DIVISION.
|
|
PROGRAM-ID. ADDTO.
|
|
DATA DIVISION.
|
|
WORKING-STORAGE SECTION.
|
|
01 WS-VALUE PIC 9(5) VALUE 100.
|
|
01 WS-RESULT PIC 9(5) VALUE 0.
|
|
01 WS-DELTA PIC 9(5) VALUE 25.
|
|
PROCEDURE DIVISION.
|
|
MAIN.
|
|
ADD 50 TO WS-VALUE.
|
|
MOVE WS-VALUE TO WS-RESULT.
|
|
ADD WS-DELTA TO WS-RESULT.
|
|
IF WS-RESULT = 175
|
|
DISPLAY 'OK: 100+50+25=175'
|
|
ELSE
|
|
DISPLAY 'ERROR: WRONG VALUE'.
|
|
STOP RUN.
|