Problem:
1. Program A calls program B.
2. Program B opens a file, then returns control to program A.
3. Program A calls program B again.
4. Program B accesses the file, assuming it is still open from program A's
prior call. This causes an immediate "47" I/O declarative error.
Apparently, working-storage variables in program B held state from the
previous call but the FILE OPEN state did not - the file has reverted to a
closed status without ever being explicitly closed. Again this behavior is
different from my 3.0 system.
Is this also a compiler directive or runtime setup issue?
Resolution:
The sub program was using EXIT PROGRAM to return to the calling program which using RM directive will close all open files.
Adding "ANSI" to the RM directive will allow the EXIT PROGRAM to keep files open.
RM"ANSI"
#AcuCobol
#RMCOBOL
#netexpress
#COBOL
#ServerExpress
