READ-FUNCTION
This function reads a record out of an indexed file.
The record locking is controlled by the f-no-lock external data-item. Move 1 to f-no-lock to read without locking. Move 0 to f-no-lock to read with lock. The default value of f-no-lock is 0.
If this function has success, RETURN-CODE is set to the size of the record read. RETURN-CODE is set to zero on failure.
Syntax
 SET READ-FUNCTION TO TRUE
 
 CALL "I$IO" USING IO-FUNCTION
                   f
                   record
                   keyNum
            GIVING returnCode
Parameters:
f
must be a valid file handle returned by OPEN-FUNCTION.
record
points to the area to hold the record read.
 
Note: in order to gain performance, in isCOBOL File Server environment the previous content of this parameter is discarded before reading. After reading, the bytes exceeding the number of read bytes are initialized to low-values.
keyNum
the key number to read from.
 
The value can be 0 or greater than 0, where 0 is the primary key, 1 is the first alternate key and so on.
Return code:
returnCode can be any signed numeric data item and provides additional information:
>0
Number of read bytes.
0
Operation failed.