Automation Engine Script Guide > Ordered by Function > Error Handling and Messages > :ON_ERROR

:ON_ERROR

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

 Syntax

:ON_ERRORReaction

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:

ACTIVATE_UC_OBJECT

LAST_OF_PERIOD

AUTOFORECAST

MODIFY_OBJECT

CANCEL_UC_OBJECT

MOVE_OBJECT

CHANGE_LOGGING

PREP_PROCESS_FILENAME

CREATE_OBJECT

REMOVE_OBJECT

EXPORT

RESTART_UC_OBJECT

FIRST_OF_PERIOD

SEND_MAIL

GET_FILESYSTEM

SEND_MSG

GET_OBJECT_TYPE

SYS_SERVER_ALIVE

GET_STATISTIC_DETAIL SYS_USER_ALIVE

IMPORT

 

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