Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 18
Setting Up File Access
Specifying Extent Sizes
For disk SIO files, you can set the primary and secondary extent sizes only if the
subsequent OPEN^FILE call will create the file (see Opening and Creating SIO Files,
later in this section). If the file already exists, then the new extent size is ignored. For
a general discussion of extents, refer to Section 2, Using the File System.
The size of primary and secondary extents can vary from 1 through 4000 pages in
increments of one page, where a page is 2048 bytes.
You can set the primary or secondary extent sizes at run time using the ASSIGN
command with the EXT option. The following example sets the primary extent to 8
megabytes and each of the secondary extents to one megabyte:
5> ASSIGN LFILE,,EXT(4000,500)
Set the extent sizes programmatically using the SET^FILE
ASSIGN^PRIMARYEXTENTSIZE and ASSIGN^SECONDARYEXTENTSIZE
operations. The following examples set primary and secondary extent sizes:
PRIMARY^EXTENT^SIZE := 4000;
SECONDARY^EXTENT^SIZE := 500;
CALL SET^FILE(DFILE,
ASSIGN^PRIMARYEXTENTSIZE,
PRIMARY^EXTENT^SIZE);
CALL SET^FILE(DFILE,
ASSIGN^SECONDARYEXTENTSIZE,
SECONDARY^EXTENT^SIZE);
If you do not specify extent sizes, the default values are 8 pages for the primary extent
and 32 pages for each secondary extent. The maximum number of extents is 500.
Specifying the Physical-Block Length
The physical-block length is the number of bytes transferred between the file and the
process in one I/O operation. You indicate blocking by setting the physical-block
length. You must set the physical-block length when accessing a file in EDIT format.
A physical block is made up of one or more records. If the block length is not exactly
divisible by the record length, then the portion of the block following the last record is
filled with blanks.
You can set the physical-block length at run time using the ASSIGN command with the
BLOCK option. The following example sets the block length to 2048 bytes:
6> ASSIGN LFILE,,BLOCK 2048