How does natural handle the open and close on the write stmt

In cobol, we do the file open and close ourselves. But in natural there are no open and close commands. So my question is , when is the open and the close performed?

I have a Natural batch program that is performing writes, then I call several ‘CALLNAT’ modules and they write to the same output file. Are there several open and closes happening or just 1 open and 1 close?

Natural determines when to open Work (sequential) files through the Natural Parameter (NatParm) WORK (or the macro NTWORK). WORK specifies whether the files will be opened upon execution of a module containing a READ WORK or WRITE WORK statement, or whether the open is deferred until the specific statement is executed. The choice is significant if execution of the statements is conditional.

Natural will automatically close all open files at the end of a session. You can close a file explicitly with the CLOSE WORK statement. After the CLOSE WORK, Natural will re-open the file upon execution of another READ WORK or WRITE WORK.

The files remain open across subprogram calls (CALLNAT), so in your example, there is only one open and one close per Work file.

My preference is to open files upon statement execution.