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—QISAMException 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:
- Record
Not Found: The logical record with the specified key is not found
in the data set. This happens if the specified key is higher than
the highest key in the highest-level index or if the record is not
in either the primary area or the overflow area of the data set.
- Invalid Actual Address for Lower Limit condition is reported if
the specified lower limit address is outside the space allocated to
the data set.
- Space Not Found for Adding a Record: The space allocated
to the data set is already filled. In locate mode, a buffer segment
address is not provided. In move mode, data is not moved.
- Invalid Request: (1) The data set is already being referred
to sequentially by the application program, (2) the buffer cannot
contain the key and the data, or (3) the specified type is not also
specified in the DCBMACRF field of the data control block.
- Uncorrectable Input Error: The control program's error
recovery procedures encounter an uncorrectable error when transferring
a block from secondary storage to an input buffer. The buffer address
is placed in register 1, and the SYNAD exit routine is given control
when a GET macro instruction is issued for the first logical record.
- Uncorrectable
Output Error: The control program's error recovery procedures
encounter an uncorrectable error when transferring a block from an
output buffer to secondary storage. If the error is encountered during
closing of the data control block, bit 2 of DCBEXCD2 is set to 1 and
the SYNAD exit routine is given control immediately. Otherwise, control
program action depends on whether load mode or scan mode is being
used.
If a data set is being created (load mode), the SYNAD exit routine
is given control when the next PUT or CLOSE macro instruction is issued.
If a failure to write a data block occurs, register 1 contains the
address of the output buffer, and register 0 contains the address
of a work area containing the first 16 bytes of the IOB; for other
errors, the contents of register 1 are meaningless. After appropriate
analysis, the SYNAD exit routine should close the data set or end
the job step. If records are to be subsequently added to the data
set using the queued indexed sequential access method (QISAM), the
job step should be terminated by issuing an abend macro instruction.
(Abend closes all open data sets. However, an ISAM data set is only
partially closed, and it can be reopened in a later job to add additional
records by using QISAM.) Subsequent execution of a PUT macro instruction
would cause reentry to the SYNAD exit routine, because an attempt
to continue loading the data set would produce unpredictable results.
If a data set is being processed (scan mode), the address of the
output buffer in error is placed in register 1, the address of a work
area containing the first 16 bytes of the IOB is placed in register
0, and the SYNAD exit routine is given control when the next GET macro
instruction is issued. Buffer scheduling is suspended until the next
GET macro instruction is reissued.
- Block Could Not Be
Reached (Input) condition is reported if the control program's error
recovery procedures encounter an uncorrectable error in searching
an index or overflow chain. The SYNAD exit routine is given control
when a GET macro instruction is issued for the first logical record
of the unreachable block.
- Block Could Not Be Reached (Update): The control program's
error recovery procedures encounter an uncorrectable error in searching
an index or overflow chain.
If the error is encountered during closing of the data control
block, bit 2 of DCBEXCD2 is set to 1 and the SYNAD exit routine is
given control immediately. Otherwise, the SYNAD exit routine is given
control when the next GET macro instruction is issued.
- Sequence Check: A
PUT macro instruction refers to a record whose key has a smaller numeric
value than the key of the record previously referred to by a PUT macro
instruction. The SYNAD exit routine is given control immediately;
the record is not transferred to secondary storage.
- Duplicate
Record: A PUT macro instruction refers to a record whose key duplicates
the record previously referred to by a PUT macro instruction. The
SYNAD exit routine is given control immediately; the record is not
transferred to secondary storage.
- Data Control Block Closed When Error Routine
Entered: The control program's error recovery procedures encounter
an uncorrectable output error during closing of the data control block.
Bit 5 or 7 of DCBEXCD1 is set to 1, and the SYNAD exit routine is
immediately given control. After appropriate analysis, the SYNAD routine
must branch to the address in return register 14 so that the control
program can finish closing the data control block.
- Overflow Record: The input record is an overflow record.
The SYNAD exit routine is entered only if bit 4, 5, 6, or 7 of DCBEXCD1
is also on.
- Incorrect
Record Length: The length of the record as specified in the record-descriptor
word (RDW) is larger than the value in the DCBLRECL field of the data
control block.