Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 67
Initializing FCBs
Initializing FCBs
You now need to associate each of the FCBs just allocated with a physical file. For
FCBs allocated with FCBSIZE, use the SET^FILE INIT^FILEFCB operation. For FCBs
allocated with FCBSIZE^D00, use the SET^FILE INIT^FILEFCB^D00 operation:
CALL SET^FILE(INFILE,
INIT^FILEFCB);
CALL SET^FILE(OUTFILE,
INIT^FILEFCB);
CALL SET^FILE(DFILE,
INIT^FILEFCB);
CALL SET^FILE(RECVFILE,
INIT^FILEFCB^D00);
CALL SET^FILE(COMMON^FCB,
INIT^FILEFCB^D00);
Naming FCBs
Use the SET^FILE ASSIGN^FILENAME operation to associate an FCB with a physical
file. You must perform this operation once for each file that SIO procedures will
access, including the $RECEIVE file.
The following example assigns a name to the input file. Both the native (pTAL) and
TNS (TAL) forms of the SET^FILE call are shown.
pTAL:
CALL SET^FILE(INFILE,ASSIGN^FILENAME,,,@INFILENAME);
TAL:
CALL SET^FILE(INFILE,ASSIGN^FILENAME,@INFILENAME);
Note that the procedure call takes the address of the file name. In this case, the actual
name of the input file has already been read from the Startup message and placed into
a buffer named INFILENAME.
Setting Up File Access Without INITIALIZER
The following paragraphs describe how to set up the characteristics that control access
to an SIO file that is initialized without the use of the INITIALIZER procedure. These
paragraphs describe how to set the access mode, exclusion mode, record length, file
code, extent sizes, and block length.
Typically, you set file characteristics by putting information into the FCB of the file using
calls to the SET^FILE procedure. Because you are not using INITIALIZER, it is less
convenient to set the file-access characteristics by issuing ASSIGN commands before
running the program.