Example: SHOWCB macro (display a physical error message)

In this example, a SHOWCB macro is used to display a physical error message. This example assumes that there is no SYNAD routine (or the SYNAD exit is inactive). In this case, VSAM returns control to your program following the last executable instruction if a physical error occurs. Register 15 indicates a physical error (12), and the feedback field in the request parameter list contains a code identifying the error. The message area contains more details about the error. Register 1 points to the request parameter list.
REQUEST RPL    MSGAREA=MESSGES, MSGLEN=128                             x
        .
        SHOWCB AREA=MSGADDR,                                           x
               FIELDS=MSGAREA,                                         x
               LENGTH=4,                                               x
               RPL=REQUEST
 
        LTR    15,15
        BNZ    CHECKO
        .
CHECKO  ...                         Display failed.
        .
MESSGES DS     CL128                 For VSAM to give you a detailed   x
                                     message about a physical error.
 
MSGADDR DS     F                     For displaying the address of the x
                                     message area with SHOWCB.

The RPL macro in this example provides for a message area, MESSGES, of 128 bytes to be used for any physical error message.

The SHOWCB macro's parameters are: