The EXIT PROGRAM statement closes all files that the subprogram being exited has open, if you set the RM Compiler directive when you submit your source code to your COBOL system.
However, if you specify the RM"ANSI" Compiler directive, the EXIT PROGRAM statement does not do this.