94400d50d4
作为子目录纳入系统,与核心测试管道协同 Co-Authored-By: Claude <noreply@anthropic.com>
11-divide-25 — 25-Division File Splitter
电信业务场景
明细25分割。将请求书明细行按25件一个文件进行分割。
Demonstrates dividing input records into groups of 25:
- PERFORM VARYING counter: Track record numbers across the loop
- DIVIDE ... GIVING REMAINDER: Calculate file number from record count
- Close-write cycle: Close old file, open new file at each boundary
- Tested at boundary conditions: 25 (exact), 26 (one extra), 24 (one short)
Files
| File | Purpose |
|---|---|
main-11-divide-25.cbl |
COBOL program (fixed format) |
data-gen.sh |
Generate N test records (default 26) |
run.sh |
Compile + run 3 test cases |
Algorithm
DIVIDE record-count BY 25 GIVING Q REMAINDER R
IF R = 1 → open new FILE-OUT-NN
Write record to current file
Output Files
- FILE-OUT-01.DAT: records 1-25
- FILE-OUT-02.DAT: records 26-50
- etc.