OPEN The OPEN statement is used to open a file for input or output. Syntax: open ( file_variable, “file_name”, INPUT | OUTPUT) where file_variable is assigned to a file_name for INPUT or OUTPUT. The following rules apply: ● The file being opened must already exist ● If a file is opened for output, it cannot be reopened before it is closed ● The same file cannot be opened for both input and output Example: open (file1, “/csw/source/sample.data”, INPUT)
The OPEN statement is used to open a file for input or output.
file_variable
file_name
INPUT
OUTPUT.
●
The file being opened must already exist
If a file is opened for output, it cannot be reopened before it is closed
The same file cannot be opened for both input and output