Return code of 12 or higher

The dialog can use the ISPF dialog management CONTROL service to set the error mode to RETURN, or CANCEL, which is the default. See the CONTROL service in Description of the ISPF services for detailed information.

The error mode setting determines what happens when a return code is 12 or higher. There are two error modes:
CANCEL
Displays and logs a message, then stops the dialog and displays the previous Primary Option Menu.
RETURN
Formats an error message, but does not display or log it. Returns to the function that invoked the service, passing back the designated return code.

In CANCEL mode, control is not usually returned to the function that invoked the service. Consequently, the function does not see a return code of 12 or higher, so you do not have to include logic to process errors of this severity.

However, ISPLINK returns a code of 20 to the dialog when an invalid ISPF environment causes the error. In this situation, ISPF cannot display a panel to show the error. Control is returned to the dialog, even though the return code is 12 or higher.

In RETURN mode, control returns to the function that invoked the service. That function must have logic to handle return codes of 12 or higher.

The RETURN mode applies only to the function that invoked the CONTROL service. If a lower-level function is invoked, it starts out in CANCEL mode. When a function returns to the higher-level function that invoked it, the mode that the higher-level function was operating in resumes.