If you are specifying the SYNAD exit as a keyword
of the AMP statement, you must define a RACF FACILITY class profile
with the resource name of IDA.VSAMEXIT.xxxxxxxx where xxxxxxxx is
the module name specified on the SYNAD keyword. You must give users
at least READ authority to the facility class resource name in order
to invoke the exit. This is not necessary if the SYNAD exit is
coded on an EXLST within the program.
The main problem with a physical error is the possible loss of data. You should try to recover your data before continuing to process. Input operation (ACB MACRF=IN) errors are generally less serious than output or update operation (MACRF=OUT) errors, because your request was not attempting to alter the contents of the data set.
If the routine cannot correct an error, it might print the physical-error message, close the data set, and terminate the program. If the error occurred while VSAM was closing the data set, and if another error occurs after the exit routine issues a CLOSE macro, VSAM doesn't exit to the routine a second time.
If the SYNAD routine returns to VSAM, whether the error was corrected or not, VSAM drops the request and returns to your processing program at the instruction following the last executed instruction. Register 15 is reset to indicate that there was an error, and the feedback field in the RPL identifies it.
Physical errors affect positioning. If a GET was issued that would have positioned VSAM for a subsequent sequential GET and an error occurs, VSAM is positioned at the control interval next in key (RPL OPTCD=KEY) or in entry (OPTCD=ADR) sequence after the control interval involved in the error. The processing program can therefore ignore the error and proceed with sequential processing. With direct processing, the likelihood of re-encountering the control interval involved in the error depends on your application.
If the exit routine issues GENCB, MODCB, SHOWCB, or TESTCB and returns to VSAM, it must provide a save area and restore registers 13 and 14, which these macros use.
See Example of a SYNAD User-Written Exit Routine for the format of a physical-error message that can be written by the SYNAD routine.
When your SYNAD exit routine completes processing, return to your main program as described in Return to a Main Program.
If a physical error occurs and no SYNAD routine is provided (or the SYNAD exit is inactive), VSAM returns codes in register 15 and in the feedback field of the RPL to identify the error.