Exchange/RJE Manual
READ Procedure
Exchange/RJE System Procedure Calls
5–24 104698 Tandem Computers Incorporated
count-read
INT:ref:1
returns the number of bytes in the record read from the line server. This
parameter is used only for wait I/O. For nowait I/O, you can omit this parameter;
the number of bytes read is returned in the
count-transferred
parameter of
the AWAITIO procedure that completes the read operation.
tag
INT(32):value
identifies individual nowait I/O operations when a single file can have two or
more nowait I/O operations outstanding at the same time. The value of
tag
is a
unique, arbitrary value that your program defines for each nowait I/O operation.
A subsequent call to AWAITIO that completes this I/O operation returns this
value to your program, identifying this I/O operation as the nowait I/O operation
that just completed.
If your program has no more than one outstanding nowait I/O operation against a
single file at one time, you can omit this parameter. In this case, the file number
returned by AWAITIO uniquely identifies the I/O operation that was completed.
If you opened the line server for wait I/O operations, omit this parameter.
Line Activity The READ procedure does not initiate any line activity, but it does set up the line
server to respond to transmissions from the remote system. The following paragraphs
discuss how the READ procedure handles transmissions from the remote system.
Initial Call to READ
If this is the first call to READ or the first call following a completed send operation,
the line is in the control state and neither the line server nor the remote system controls
the line. In this case, the call to READ causes the line server to accept a bid for the line
from the remote system (the remote system sends ENQ). After the line server has
accepted the bid (responds with an ACK 0), the line server accepts the first block sent
by the remote system. The first record from this block is returned to your program in
buffer
.
If the remote system does not bid for the line in time, the call to READ returns with a
time-out error (error 162). The amount of time to wait for the line bid is specified for
the data communications line during system generation.
Subsequent Calls to READ
After the initial call to READ, the line is in the message state and the remote system
controls the line (has permission to transmit). In this case, no bid for the line is
required. Each subsequent call to READ returns a single record to your program in
buffer
. The line server handles receiving and acknowledging blocks from the remote
system as required.