Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 66
Allocating FCBs
The following list introduces the steps involved in initializing SIO files without using TAL
or pTAL DEFINEs:
1. Allocate space for each FCB. This step is required.
2. Initialize an empty FCB for each file. This step is required.
3. Specify the physical file name for each FCB. This step is required.
4. Set up the file-access characteristics. This step is optional; if omitted, the system
uses default values.
The following paragraphs provide details on how your program can perform the above
steps. At the end of this subsection is a sample initialization.
Allocating FCBs
You must allocate space for each file FCB and the common FCB using a suitable
declaration. If your program will read the Startup message using SIO, then you must
also allocate space for an FCB for the $RECEIVE file.
The following declarations allocate space for an input file, an output file, an additional
data file, the $RECEIVE file, and the common FCB:
INT .INFILE[0:FCBSIZE - 1],
.OUTFILE[0:FCBSIZE - 1],
.DFILE[0:FCBSIZE - 1],
.RECVFILE[0:FCBSIZE^D00 - 1],
.COMMON^FCB[0:FCBSIZE^D00 - 1];
The literals FCBSIZE and FCBSIZE^D00 are defined in the GPLDEFS file. Note that
$RECEIVE and the common FCB are the only FCBs for which FCBSIZE^D00 is used.
FCBSIZE is preferred for the other FCBs because it uses less space.
Note. FCBs for native processes require more memory than those for TNS processes.