Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 62
Handling Fatal Errors
abnormally terminating the process. The following example sets the
ABORT^OPENERR flag:
FLAGS := ABORT^OPENERR;
FLAGS^MASK := ABORT^OPENERR;
CALL OPEN^FILE(COMMON^FCB,
INFILE,
!block^buffer!,
!block^bufferlen!,
FLAGS,
FLAGS^MASK);
Clearing the ABORT^OPENERR flag allows the process to continue, in spite of
fatal errors. If an error occurs, the open will not finish and an error message is
sent to the error file. The following example shows how to clear the
ABORT^OPENERR flag:
FLAGS^MASK := ABORT^OPENERR;
CALL OPEN^FILE(COMMON^FCB,
INFILE,
!block^buffer!,
!block^bufferlen!,
!flags!,
FLAGS^MASK);
By default, the ABORT^OPENERR flag is set.
Handling I/O Errors
You can choose whether to terminate the process on receipt of a fatal I/O error or to
continue without completing the I/O operation. The error message is written to the
error file whether you choose to terminate or not.
Use the ABORT^XFERERR flag to choose whether to terminate the process in
response to a fatal error returned by a READ^FILE or WRITE^FILE procedure call.
The effects of setting or clearing the ABORT^XFERERR flag are as follows:
If you set the ABORT^XFERERR flag, then a fatal I/O error causes the system to
close all SIO files opened by this process and to terminate the process.
If you clear the ABORT^XFERERR flag, then SIO routines report the error to the
error file and the process continues. Your program can process the returned error
number if desired.
By default, the ABORT^XFERERR flag is set on.
You can set the ABORT^XFERERR flag when you open the file with the OPEN^FILE
procedure, or you can change the setting of the flag using the SET^FILE
SET^ABORT^XFERERR operation.
The following example sets the ABORT^XFERERR flag when the file is opened:
CALL OPEN^FILE(COMMON^FCB,
INPUT,