R-OPEN-FUNCTION
This function opens an existing relative file. If it is successful, the value in RETURN-CODE should be moved to a data item that is USAGE HANDLE. This data item is passed as the open file handle to the other file handling functions.
If it fails, RETURN-CODE is set to ZERO.
This function only opens already existing files. If the file does not exist, the function fails, even when opening for output.
Syntax:
 SET R-OPEN-FUNCTION TO TRUE
 
 CALL "R$IO" USING RIO-FUNCTION
                   name
                   mode 
                   maxSize
                   minSize
            GIVING returnCode
Parameters:
name
the name of the file to open.
mode
one of the following values (defined in isfilesys.def):
 
Finput
Foutput
Fio
Fextend
Open for input only.
Open for output only.
Open for input and output.
Same as Foutput.
mode may also have one of the following flags (defined in isfilesys.def) added to it to indicate file locking options:
Fread_lock
Fwrite_lock
Fmass_update
Locks file against other updaters.
Locks file against all others.
Same as Fwrite_lock.
maxSize
the maximum record size.
minSize
the minimum record size. It should be equal to max-size, since relative files can’t be variable lenght.
Return code:
returnCode can be any signed numeric data item and provides additional information:
>0
File handle.
0
Operation failed.