Files
cobol-java-v3/test-data/cobol/statement_arithmetic/ST-DIV-BY-GIVING.cbl
T
NB-076 8c1f9114f6 feat: add COBOL statement benchmark plan and 34 P0 sample programs
- 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
2026-06-21 12:02:25 +08:00

26 lines
834 B
COBOL

* ==== TYPE: ST-DIV-BY-GIVING ====
* FEATURE: DIVIDE ... BY ... GIVING ... REMAINDER
* STATEMENT: DIVIDE BY GIVING
* BRANCHES: 4, DECISIONS: 2
IDENTIFICATION DIVISION.
PROGRAM-ID. DIVBYG.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-A PIC 9(5) VALUE 100.
01 WS-B PIC 9(5) VALUE 30.
01 WS-RESULT PIC 9(5) VALUE 0.
01 WS-REM PIC 9(5) VALUE 0.
PROCEDURE DIVISION.
MAIN.
DIVIDE WS-A BY WS-B GIVING WS-RESULT
REMAINDER WS-REM.
IF WS-RESULT = 3
DISPLAY 'OK: QUOTIENT=3'
ELSE
DISPLAY 'ERROR: QUOTIENT'.
IF WS-REM = 10
DISPLAY 'OK: REMAINDER=10'
ELSE
DISPLAY 'ERROR: REMAINDER'.
STOP RUN.