%OPEN (Return File Open Condition)
%OPEN(file_name)
%OPEN returns '1' if the specified file is open. A file is considered "open" if it has been opened by the RPG module during initialization or by an OPEN operation, and has not subsequently been closed. If the file is conditioned by an external indicator and the external indicator was off at module initialization, the file is considered closed, and %OPEN returns '0'.
For more information, see File Operations or Built-in Functions.