Business requirements
Business Requirements Document[edit]
Project: pgcobol — Prime Numbers Application
Version: 1.0 (reverse-engineered)
Date: 2026-03-17
Status: Baseline
1. Purpose[edit]
The system generates prime numbers and stores them in a relational database, and provides a printed report of all stored primes. It demonstrates a three-tier COBOL application architecture running on Linux against a PostgreSQL database.
2. Stakeholders[edit]
| Role | Concern |
|---|---|
| Developer / operator | Runs generation and reporting jobs from the command line |
| Database administrator | Manages schema, credentials, and data retention |
| End user | Receives the printed prime-number report |
3. Business Requirements[edit]
BR-01 — Prime Number Generation[edit]
The system shall compute all prime numbers from 3 up to 999,999,999 using a trial-division algorithm and store each confirmed prime in the database.
Acceptance criteria: - Every integer stored in the primes table is a prime number. - No prime in the range 3–999,999,999 is omitted. - The sequence column records insertion order via an auto-incrementing identity.
BR-02 — Prime Number Reporting[edit]
The system shall produce a formatted printed report listing all primes currently stored in the database.
Acceptance criteria: - Every row in the primes table appears in the report. - Rows are presented in database-cursor order (insertion order by ident). - The report is paginated with headings, column headers, and page numbers.
BR-03 — Operational Modes[edit]
The system shall support two mutually exclusive operational modes selectable at invocation:
| Mode | Argument | Effect |
|---|---|---|
| Generate | generate
|
Compute primes and persist to DB |
| Report | report
|
Read DB and produce print file |
Any argument other than generate or report shall cause the program to log an error and terminate without processing.
BR-04 — Audit Trail / Console Logging[edit]
All significant processing events (session start/stop, database connection, cursor open, fetch errors, write confirmation) shall be written to the system console in real time.
BR-05 — Data Persistence[edit]
Prime numbers shall be stored persistently in a PostgreSQL database so that the report can be produced independently of and after the generation run.
BR-06 — Report Format[edit]
The printed report shall: - Carry a page heading (“primes overview”) and a column header row on every page. - Present six prime entries per print line (sequence number + prime value). - Carry a page-number footing at the bottom of each page. - Be written to a line-sequential file (primes.prt) with 132-character records.
4. Constraints[edit]
| ID | Constraint |
|---|---|
| C-01 | Target runtime is GnuCOBOL 4.0 on Linux. |
| C-02 | Database is PostgreSQL 11; connection is localhost only. |
| C-03 | Database credentials are currently hard-coded in the DAL program. |
| C-04 | The upper bound of generation is fixed at 999,999,999. |
| C-05 | The print file is fixed at 132 columns, 56 lines per page. |
5. Out of Scope[edit]
- Interactive (screen) input or output.
- Concurrent multi-user access.
- Prime generation restart / checkpoint recovery.
- Authentication or credential management.
- Scheduling or job-control integration.
Terug naar: Primes_programs_specifications | Cobol and PostgreSQL