Exchange/SNA Manual
Step-by-Step Instructions
Using the Exchange/SNA Programmatic Interface
4–12 104700 Tandem Computers Incorporated
Step 4: Perform the
Operation
This step is the performance of your program’s task, be it sending files, receiving files,
both sending and receiving files, or controlling the console.
Sending Files
Use the WRITE procedure to pass records to the subdevice for transmission to the host
system. The basic procedure for sending a file is outlined below. These steps assume
you have already performed steps 1 (start line server), 2 (open device for write-only
access), and 3 (set operational parameters) as outlined above.
1. Open the file to be sent.
2. Call READ (or WRITEREAD) and read a record from the file.
3. Call WRITE (or WRITEREAD) and pass the record to the subdevice for
transmission to the host system. If you use WRITEREAD, it must specify write-
only (read count set to 0).
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 EDS (a type 1 FM header with end destination selection specified) to the
host system. This is required to indicate the end of the file to the host system and
to force the transmission of any records remaining in the line server’s buffers. If
you want to send several files as a single data stream, wait until the end of the last
file is reached before calling the CONTROL procedure.
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
subdevice, 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 subdevice for transmission to the host
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 little benefit can be gained from using nowait I/O operations
with both the subdevice and the file being sent. This is because there is nothing to do
while both READ and WRITE are in progress.