The example in Figure 1 demonstrates a user-written
exit routine. It is a SYNAD exit routine that examines the FDBK field
of the RPL checking for the type of physical error that caused the
exit. After the checking, special processing can be performed as necessary.
The routine returns to VSAM after printing an appropriate error message
on SYSPRINT.
Figure 1. Example of a SYNAD exit routineACB1 ACB EXLST=EXITS
EXITS EXLST SYNAD=PHYERR
RPL1 RPL ACB=ACB1,
MSGAREA=PERRMSG,
MSGLEN=128
PHYERR USING *,15 This routine is nonreentrant.
* Register 15 is entry address.
.
. Save caller's register
(1, 13, 14).
LA 13,SAVE Point to routine's save area.
.
. If register 1=address of RPL1,
. then error did not occur for a
CLOSE.
SHOWCB RPL=RPL1,
FIELDS=FDBK,
AREA=ERRCODE,
LENGTH=4
* Show type of physical error.
.
. Examine error, perform special
. processing.
PUT PRTDCB,ERRMSG Print physical error message.
.
. Restore caller's registers
. (1, 13, 14).
BR 14 Return to VSAM.
.
.
.
ERRCODE DC F'0' RPL reason code from SHOWCB.
PERRMSG DS 0XL128 Physical error message.
DS XL12 Pad for unprintable part.
ERRMSG DS XL116 Printable format part of message.
.
.
.
PRTDCB DCB ..... QSAM DCB.
SAVE DS 18F SYNAD routine's save area.
SAVREG DS 3F Save registers 1, 13, 14.