Exchange/RJE Manual

Programming Considerations
Using the Exchange/RJE Programmatic Interface
4–4 104698 Tandem Computers Incorporated
Disadvantage of Wait I/O. The disadvantage of wait I/O operations is that your program
cannot do anything until the I/O operation completes. This is a disadvantage only if
there is some useful work to be done while the I/O operation is in progress. For
example, if your program waits for a user to enter a command from a terminal, it may
not make sense to use nowait I/O operations with the terminal because your program
does not know what to do until the user enters the command. In this case, there is no
useful work to be done while the I/O operation is in progress.
Advantage of Nowait I/O. The advantage of nowait I/O operations is performance. They
allow your program to perform useful work while I/O operations are in progress. A
typical use of nowait I/O operations is to perform overlapping, concurrent I/O
operations. While an I/O operation is in progress on one file, your program can
initiate another I/O operation on another file. In this way, both I/O operations can be
in progress at once, which can sometimes result in better performance for your
program overall.
Disadvantage of Nowait I/O. The disadvantage of nowait I/O operations is that they
introduce complexity into your program that may not be required by the task to be
performed. Nowait I/O operations require calls to AWAITIO that are not required by
wait I/O operations, and nowait I/O operations can require code to keep track of
multiple outstanding I/O operations. Moreover, the calls to AWAITIO must be
incorporated into your program in such a way that they synchronize the execution of
your program with the completion of the outstanding nowait I/O operations. For
example, if your program is using nowait I/O operations to send a file to a remote
system through the Exchange/RJE line server, you do not want to write the next
record to the line server until the nowait I/O operation that reads that record from the
file has completed.
Error Handling Your program must check the condition code after each I/O operation to determine if
the I/O operation completed successfully. Failure to do so can result in undetected
errors and the unpredictable operation of your program.
After each I/O procedure call, the condition code can be in one of the following states:
Symbol Abbreviation Meaning
< CCL an error occurred
= CCE no error occurred
> CCG a warning occurred
If an error or warning occurred, your program should call the FILEINFO procedure to
retrieve the error number, which indicates the specific error or warning.