Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 65
Closing SIO Files
Errors Resulting From Path or Device Failure
Errors that result from a path or device failure include the following:
For error 201 (unable to communicate over this path), SIO retries the error once. For
the other errors, SIO retries the error if the type of operation and the type of device
suggest that a retry is appropriate. In all cases where no retry is performed, SIO treats
the error as fatal.
Closing SIO Files
Use the CLOSE^FILE procedure to close SIO files. You can close all SIO files by
specifying the common FCB:
CALL CLOSE^FILE(COMMON^FCB);
Closing the file with CLOSE^FILE flushes the buffers, thereby ensuring data integrity.
Terminating the process also closes any files that remain open; however, you would
lose any data that remains in the block buffers.
For SIO files open for nowait I/O, CLOSE^FILE waits for the completion of any
outstanding I/O operation and closes the file.
Initializing SIO Files Without TAL or
pTAL DEFINEs
You can set up FCBs for SIO files without using TAL or pTAL DEFINEs. The
advantage of initializing FCBs this way is that you can determine how many FCBs you
need at run time and dynamically allocate as many FCBs as you need. However, you
must write code to perform the initialization function; for example, if the process
receives its input and output files through the Startup message, then you must write
code to directly access the $RECEIVE file.
As when using TAL or pTAL DEFINEs, your program should make use of the
$S
YSTEM.SYSTEM.GPLDEFS file to provide literals used in initialization. The
following compiler directives include the file in your code:
?NOLIST
?SOURCE $SYSTEM.SYSTEM.GPLDEFS
?LIST
Error 120 Data parity
Error 200 Device is owned by the other port
Error 201 through
231
Path error
Error 240 Line handler error; did not get started