Exchange/RJE Manual
Step-by-Step Instructions
Using the Exchange/RJE Programmatic Interface
104698 Tandem Computers Incorporated 4–15
3. Call WRITE (or WRITEREAD) and pass the record to the line server for
transmission to the remote system.
4. Repeat steps 2 and 3 until the end of the file is reached.
5. Call the CONTROL procedure with the operation parameter equal to 2. This
sends an ETX (end of text or file) to the remote system. This is required to indicate
the end of the file to the remote system and to force the transmission of any
records remaining in the line server’s buffers.
The above procedure assumes that all I/O operations are wait I/O operations. The
above procedure needs to be modified if your program is using nowait I/O
operations. For example, if your program uses nowait I/O operations with the line
server, the loop in steps 2, 3, and 4 above could be replaced by the steps shown below.
1. Call READ and read the first record from the file to be sent. This is a wait I/O
operation.
2. Call WRITE and pass a record to the line server for transmission to the remote
system. This is a nowait I/O operation.
3. Call READ and read the next record from the file. This is a wait I/O operation.
However, this read begins before the preceding write has completed; both
operations are performed concurrently.
4. Call AWAITIO and wait for the call to WRITE to complete.
5. Repeat steps 2 through 4 until the end of the file to be sent is reached.
The above procedure illustrates just one of many ways to use nowait I/O operations to
send files. Note that there is little benefit to be gained from using nowait I/O
operations with both the line server and the file being sent. This is because there is
nothing to do while both the read and the write are in progress.
Receiving Files
Use the READ procedure to read the records that the line server has received from the
remote system. The basic procedure for receiving a file is outlined below.
1. Open the file in which the received records are to be written.
2. Call READ (or WRITEREAD) and read a record from the line server.
3. Call WRITE (or WRITEREAD) and write the received record to the file.
4. Repeat steps 2 and 3 until an ETX (end of text or file) is received from the remote
system.
The above procedure assumes that all I/O operations are wait I/O operations. The
above procedure needs to be modified if your program is using nowait I/O
operations. For example, if your program uses nowait I/O operations with the file to
which the receive records are written, the loop in steps 2, 3, and 4 above could be
replaced by the steps shown on the following page.