0

I started study (again) Cobol, And I found GnuCobol as compiler possibility to use at my Linux box.

So, my problem consist at read a sequential file from beginning without reopen, because it is into a procedure. If I reopen, all work is lost :-(.

If someone knows how to do it, please help me.

I read all GnuCobol documentation, but I nothing found.

  • Just to clarify - you want to read from a file which you've wrote to which is still open for writing? Note: the OS may not have flushed that to disk... But you likely want to `CLOSE`, `OPEN-INPUT`, `READ`, `OPEN EXTEND`. – Simon Sobisch Apr 19 '23 at 15:57
  • Indeed, I want perform a key search from 1st record without CLOSE/OPEN statements. They consume a lot of time. – Luciano Junior Apr 19 '23 at 18:18
  • It sounds like you'd be better using `ORGANIZATION INDEXED` (ISAM) which allows both sequential and direct reads and writes at any time, opening it with `OPEN INPUT-OUTPUT`. – Simon Sobisch Apr 19 '23 at 19:32
  • What do you think of posting whatever worked for you as answer? – Simon Sobisch May 11 '23 at 11:18

0 Answers0