Files
cobol-java-v3/benchmark-programs/26-db-search

26-db-search — Database Search Simulation

电信业务场景

客户信息DB检索。使用索引文件模拟数据库检索,支持单键查询和范围查询,用于客户信息确认。

Purpose

Simulates database search/retrieval patterns using GnuCOBOL INDEXED files with START + READ NEXT.

Test Coverage

  1. Single key search — READ with KEY IS for exact match retrieval
  2. Range search — START with NOT LESS THAN, iterate until upper bound
  3. Full scan — START from LOW-VALUES, read all records in key order
  4. Range with no results — START with no matching records

Key Techniques

  • INDEXED file with DYNAMIC access mode
  • START command for conditional positioning
  • READ NEXT for sequential traversal
  • KEY IS / GREATER THAN / NOT LESS THAN conditions
  • FILE STATUS checking