Appendix A:  Error Detection and Testing

This appendix summarizes the many features that ACCENT R provides for error detection and testing.  These features make it possible to suppress, replace, or supplement ACCENT R messages and to control execution under error conditions.  The features are all described below in alphabetical order.

@ABORT.CM

The system field @ABORT.CM can be used to control execution when a program aborts.  A CM name set to that field executes if an abort condition occurs in either a CM or SF.  ERROR ABORT must be enabled and the named CM must be in the current DBL for the switch to occur.  An error message is generated before control is passed to the CM.  ACCENT R checks the syntax of a name set to @ABORT.CM, but does no other checking.  If there is no name in @ABORT.CM, control returns to the terminal.  (A character field of length 40.)

@AUX

The system field @AUX contains a five-character string that is a key to the last error that occurred in regard to an auxiliary Data Set.  This field is set to "NO" at the beginning of each ACCENT R session and is also reset to "NO" before each operation on an auxiliary Data Set.  The strings that can be set to @AUX and the meanings are as follows:

 

String in @AUX

Meaning

CLOSE

Failed CLOSE statement.

DUP

Creation of record with duplicate key values was prevented.

EMPTY

No record available in DS.

LOCK

Cannot PUT without prior GET LOCKED.  (This string occurs only when Simultaneous Update is operative.)

MISSI

Failed GET statement or PUT without prior GET.

MULT

GET and GET MULTIPLE cannot be used together without intervening FREE.  (This string occurs only when Simultaneous Update is operative.)

NO

Default value; is automatically reset to this value before the execution of any GET, PUT, READY, or CREATE statement.

OPEN

Failed OPEN statement.

YES

Successful retrieval or placement of record.

@AUX.PREFIX

The system field @AUX.PREFIX can be used to contain a string to be prefixed onto any auxiliary error message:  that is, any message related to an auxiliary DS.  This string could be used to abort a job, print special identifiers on auxiliary messages, or provide an audible alert.  (A character field of length 20.)  @ERROR.PREFIX and @WARNING.PREFIX provide parallel capabilities for error and warning messages.  See examples under @WARNING.PREFIX, below.

@ERR

The system field @ERR[:id] is available during PM execution to notify you when an error occurs relative to one of the DS's being processed.  It applies to master, transaction, and auxiliary DS's.  A non-zero value means that an error has occurred relative to the specified DS.  This field retains the last value set there by the system unless you reset it to zero.  (An integer field of length 5.)

@ERROR.MESSAGE

The system function @ERROR.MESSAGE returns the last error message or warning message generated by ACCENT R.  This function takes no arguments.  Note that the string returned cannot be changed, and is not affected by the system field @ERROR.NUMBER.

@ERROR.NUMBER

The system field @ERROR.NUMBER contains the number of the first error message since the start of the ACCENT R session or since @ERROR.NUMBER was set to zero.  If this field is going to be tested after a command or statement, it should be reset to zero just before the command or statement.  Note that changing this system field does not impact the system function @ERROR.MESSAGE.  That function always returns the last error message generated by a processing error.  (An integer field of length 5.)

@ERROR.PREFIX

The system field @ERROR.PREFIX can be used to contain a string to be prefixed onto ACCENT R error messages. This field makes it possible to abort or otherwise control batch jobs in the event of error messages.  You can also give an audible alert by using @BELL, or add blank lines for readability.  (A character field of length 20.)  @AUX.PREFIX and @WARNING.PREFIX provide parallel capabilities for auxiliary and warning messages.  See examples below under @WARNING.PREFIX.

@WARNINGS

The system field @WARNINGS contains a key to the last warning generated by ACCENT R.  The initial value is "NO".  @WARNINGS retains the last value set there by the system unless you reset it to "NO".  Strings set to @WARNINGS and their meanings are as follows:

 

String in @WARNINGS

Meaning

DELET

Cannot PUT deleted record.

DIVO

Divide by zero detected.

FUNCT

Improper argument to a function.

INPUT

Problem with ACCEPT statement.

MISSI

Field not available, not in record type, or no record to PUT.

NO

Log-in value.

OCCUR

Subscript out of bounds.

OVERF

Arithmetic overflow detected.

REPOR

PM report function not executable.

SIZE

Value too large for field.

TYPE

Wrong type data into field or invalid record type.

UNDER

Arithmetic underflow detected.

VALID

Validation clause failure.

@WARNING.PREFIX

The system field @WARNING.PREFIX can contain a string to be prefixed onto the warning message.  The default is "%".  This field makes it possible to abort or otherwise control batch jobs in the event of warning messages.  You can also give an audible alert by using @BELL, add blank lines for readability, or identify the message as being generated by ACCENT R.  (A character field of length 20.)  @AUX.PREFIX and @ERROR.PREFIX provide parallel capabilities for auxiliary and error messages.  For example,

SET '?' + @BELL TO @WARNING.PREFIX, @ERROR.PREFIX, @AUX.PREFIX

SET @CR+@CR+@CR TO @WARNING.PREFIX

SET 'ACCENT R ERROR:  ' TO @ERROR.PREFIX

ENABLE/DISABLE OPTIONS

The ENABLE/DISABLE command provides three options for suppressing ACCENT R messages.  The default condition for each is ENABLE.

{ENABLE; DISABLE} {AUX; ERROR; WARNING}

    MESSAGES [conditional clause]

where:

AUX MESSAGES controls the printing of messages during a GET, PUT READY, or CREATE operation for an auxiliary DS during PM execution.

ERROR MESSAGES controls the printing of fatal error messages during PM or CM execution.

WARNING MESSAGES controls the printing of non-fatal warning messages.

HUSH

The HUSH option available in PM statements suppresses printing of auxiliary, warning, or error messages for the execution of that statement only.  When this clause is used, @WARNINGS is set to "NO" and @ERROR.NUMBER is set to zero at the beginning of statement execution.