SYNAD Synchronous Error Routine Exit

The SYNAD parameter of the DCB or DCBE macro specifies the address of an error routine that is to be given control when an input/output error occurs. You can use this routine to analyze exceptional conditions or uncorrectable errors. I/O errors usually occur asynchronously to your program, but the access method calls your SYNAD routine synchronously to macros that your program issues.

If an I/O error occurs during data transmission, standard error recovery procedures that are provided by the operating system try to correct the error before returning control to your program. These error recovery procedures generally are asynchronous to your program. An uncorrectable error usually causes an abnormal termination of the task. However, if you specify the address of an error analysis routine (called a SYNAD routine) in the DCB or DCBE macro, that routine can try to correct or ignore the error and prevent an abnormal termination. The routine is given control when the application program issues the access method macro that requires the buffer that received the uncorrectable error. For the queued access methods this generally means after enough PUT or GET macros to fill BUFNO-1 buffers past the failing block. For the basic access methods this means when your program issues a CHECK macro for the failing DECB.

For BDAM, BSAM, BPAM, and QSAM, the control program provides a pointer to the status indicators shown in Figure 1. The block being read or written can be accepted or skipped, or processing can be terminated.

Table 1 shows the exception code bits for QISAM.

Table 1. Exception code bits—QISAM
Exception Field Code Bit   CLOSE Code GET Set PUT by PUTX   SETL   Condition If On
DCBEXCD1 0         Type K Record Not Found
  1         Type I Nonvalid actual address for lower limit
  2 X         Space not found for adding a record
  3         X Nonvalid request
  4   X       Uncorrectable input error
  5 X   X X   Uncorrectable output error
  6   X     X Block could not be reached (input)
  7 X X       Block could not be reached (update)
DCBEXCD2 0     X     Sequence check
  1     X     Duplicate record
  2 X         Data control block closed when error routine entered
  3   X       Overflow record
  4     X     Incorrect record length
  5-7           Reserved for future use
Descriptions of the conditions in Table 1 follow: