:ON_ERROR

Script Statement: Determines the reaction to particular errors and messages of script elements

 Syntax

:ON_ERROR Reaction

Syntax

Description/Format

Reaction

Keyword for the reaction to errors and messages
Format: AE name, script literal or script variable

Allowed values: "ABEND", "RESUME"
Default: "RESUME"
"ABEND" - Script processing canceled
"RESUME" - Script processing continued

Comments

This script statement influences the following script functions:

Functions

ACTIVATE_UC_OBJECT

GET_FILESYSTEM

PREP_PROCESS_FILENAME

AUTOFORECAST

GET_OBJECT_TYPE

REMOVE_OBJECT

CANCEL_UC_OBJECT

GET_STATISTIC_DETAIL

RESTART_UC_OBJECT

CHANGE_LOGGING

IMPORT

SEND_MAIL

CREATE_OBJECT

LAST_OF_PERIOD

SEND_MSG

EXPORT

MODIFY_OBJECT

SYS_SERVER_ALIVE

FIRST_OF_PERIOD

MOVE_OBJECT

SYS_USER_ALIVE

By default, AE ensures that script processing with these script functions is not aborted if errors occur. These errors can be analyzed with the Script Functions for Error Handling.

The "ABEND" parameter prompts the script processing to be aborted if an error occurs. "RESUME", on the other hand, continues the script and the return codes of the previously listed functions can be read.

Example

The example below specifies that the script will not be canceled in the event of an error. The system then attempts to check the capacity of a non-existing drive. An error occurs which can be analyzed with the script functions for error handling.

:ON_ERROR RESUME
:
SET &CHECK# = GET_FILESYSTEM('WIN21', 'Z:\', FILESYSTEM_SPACE_TOTAL)
:
SET &ERRNR# = SYS_LAST_ERR_NR
:
SET &ERRINS# = SYS_LAST_ERR_INS
:
SET &MESSAGE# = GET_MSG_TXT (&ERRNR#,&ERRINS#)

See also:

Script Elements - Error Handling and Messages

Sample Collection:
Retrieving Error Message and Number

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function