Exchange/SNA Manual
Programming Considerations
Using the Exchange/SNA Programmatic Interface
4–6 104700 Tandem Computers Incorporated
Error Handling Your program must check the condition code after each I/O operation to determine
whether or not 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.
The following fragment of TAL code illustrates the typical method of checking for
errors and the subsequent call to FILEINFO in the event of an error.
CALL READ (fnum, buffer, 80, count_read);
IF <> THEN
BEGIN !error or warning occurred
CALL FILEINFO (fnum, error); !identify the error
... !perform recovery
!if possible, else exit
END;
... !successful operation
!continues here
Nowait I/O and Errors
When performing nowait I/O operations, the procedure call that initiates a nowait
I/O operation does not set the condition code according to how the I/O operation
completed. After the initial procedure call, the condition code indicates only whether
or not the message initiating the operation was sent successfully. You still should
check the condition after the initial procedure call to check that the operation started
successfully.
The call to AWAITIO that completes a nowait I/O operation sets the condition code
according to how the I/O operation completed. You must check the condition code
after a call to AWAITIO to determine whether or not a nowait I/O operation
completed successfully.
Recoverable Errors
You can usually program your applications to recover from errors that are discovered
before the transmission starts. For example, if you receive error 12 (the OPEN call
failed because the device is busy), you can retry the request specifying another device.