cobol: Ensure SEQUENTIAL files always use ADVANCING 0
SEQUENTIAL files in libgcobol will now consistently use ADVANCING 0, preventing unexpected control character additions.
This commit modifies the behavior of sequential_file_write in libgcobol/gfileio.cc to ensure that SEQUENTIAL files always operate with ADVANCING 0. This prevents the addition of control characters that could occur with ADVANCING 1 on such files, ensuring more predictable file handling.
In Details
The sequential_file_write function in libgcobol/gfileio.cc has been updated to enforce ADVANCING 0 for SEQUENTIAL file writes. Previously, the behavior might have varied, potentially leading to control character insertion. This change standardizes the behavior, ensuring that ADVANCING is effectively treated as 0 for all SEQUENTIAL file operations, simplifying I/O management.
- SEQUENTIAL file
- A type of file organization in COBOL where records are stored and accessed in a sequential order. Data is read or written one record after another.
- ADVANCING
- A clause in COBOL I/O statements that controls whether the file position moves to the next line after a WRITE operation. For sequential files, its behavior can be constrained.
- control characters
- Non-printable characters used in data transmission or text processing to control devices or formatting, such as newline or carriage return characters.