Previous Topic: Handling Runtime ErrorsNext Topic: Coding an Error Procedure


Default Error Procedure

By default, CA Ideal provides the following error procedure. It executes when a runtime error is encountered. This procedure includes:

<<ERROR>> PROCEDURE
    IF $RC LT 12
        SET $RC EQ 12
    ENDIF
    LIST ERROR
    BACKOUT
    QUIT RUN
ENDPROC

In other words:

SET $RC EQ 12 Sets the return code to specify a fatal error.

LIST ERROR Transmits the type of error to output file.

BACKOUT Ensures that possibly incomplete updates due to the error are not applied.

QUIT RUN Terminates the application.

The LIST ERROR statement writes the values of the functions $ERROR‑TYPE, $ERROR‑CLASS, $ERROR‑DVW‑STATUS, and $ERROR‑DVW‑INTERNAL‑STATUS and the statement number to an external file. The various $ERROR functions return the value to help to identify the specific error.

By default, a message displays at the screen when a run is terminated. This message states:

RUN completed, RC = nn

The value of nn specifies the return code value.