Exchange/SNA Manual
Step-by-Step Instructions
Using the Exchange/SNA Programmatic Interface
4–14 104700 Tandem Computers Incorporated
Console Operations
This section outlines the basic procedures for a console application. These steps
assume you have already performed steps 1 (start line server) and 2 (open device for
read-only or read/write access), as outlined above. The console subdevice must be
opened for nowait I/O.
1. Call READ with nowait I/O and wait for any console output from the host.
2. Wait for the read to complete or until an event happens that requires the
application to send a message to the host. If your application both reads console
output from the host and sends console commands to the host, it may have two
nowait reads outstanding at the same time—one to the console and one to a
terminal, for example.
3. If the READ call to the console completes:
a. Process the message (usually by displaying it).
b. Post another READ call.
4. If an event happens requiring a WRITE call to the console (for example, the READ
procedure from the terminal indicates that the user wants to send a command):
a. Call CANCEL to cancel the READ call outstanding on the console.
b. WRITE the command to the console and wait for it to complete (generally with
an AWAITIO call with no timeout specified).
c. Post another READ call to the console.
5. Continue looping until you decide to quit (in which case you need to close the
console subdevice and stop your program) or until the line server goes away.
You do not receive any end-of-transmission signals from the console. Refer to the
earlier subsection “Designing Console Programs” for some important programming
considerations for a console application.
Step 5: Close the
Subdevice
After your program has completed its task, it should close the subdevice. To do this,
call the CLOSE procedure. The call to the CLOSE procedure does not stop the line
server or affect any operations initiated by other processes, such as an Exchange/SNA
command interpreter or another application program.