Visual RPG 9.0 Language Reference  

%OPEN Function- ( Return File Open Condition )

%OPEN built-in function returns True if the specified file is open.

%OPEN (File_name)

Parts

File_name

Required.  The name of the file.

Remarks

A file is considered "open" if it has been opened by the RPG program 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 program initialization, the file is considered closed, and %OPEN returns False.

Example

// This goes in main line code
DclDiskFile Name( CUSTMAST ) Type( *Input ) Org( *Indexed ) DBDesc ( 'ASNA LOCAL DB' )

BEGSR Open_Ex
 MsgBox %OPEN ( CUSTMAST )

 Close File   ( CUSTMAST )
 MsgBox %OPEN ( CUSTMAST )

ENDSR

See Also

Built-in Function Overview
IsOpen Property