READ‑ERROR: Unhandled cancellation in COBOL READ
0 reputation · 15 Oct 2024, 17:36 UTC
Goal
Design a COBOL program that can terminate a long‑running READ or WRITE operation when a user or system request occurs, ensuring no data corruption or resource leaks.
Constraints
The COBOL standard only defines READ‑ERROR and WRITE‑ERROR for file‑access failures. It does not prescribe any timeout or cancellation mechanism. Vendor extensions (e.g., platform‑specific interrupt flags or timeout clauses) are non‑portable and may be ignored or handled inconsistently. External signals like SIGINT may leave the program hanging or corrupt partially written records.
Unresolved Decision
There is no formal, portable construct in the language to abort a blocking I/O operation. The behavior of external cancellation signals is implementation‑dependent, creating uncertainty in cross‑platform applications.
Specific Questions
- Does any COBOL implementation provide a portable, standard‑conforming way to cancel a blocking READ operation?
- What is the observable effect of sending
SIGINTor an equivalent interrupt during a READ on a networked file system? - Are there recommended coding patterns or vendor‑specific features that allow graceful timeout handling without risking data corruption?