Enscribe Programmer's Guide
maximum number of extents to be allocated for the file (16 or more for nonpartitioned unstructured
files). If you do not specify extent sizes, both the primary and secondary extent sizes default to one
page.
If you do not specify a maximum number of extents, MAXEXTENTS defaults to 16.
For nonpartitioned unstructured files, you can change the MAXEXTENTS value dynamically during
program execution by using either the SETMODE 92 system procedure or the FUP ALTER command.
Restrictions on Partitioned Unstructured files
The following restrictions apply to partitioned unstructured files on an XP storage array and on
H-series, J-series, and S-series internal disks:
• All extents must be a multiple of 14 pages.
• All partitions must have identical extent sizes and maximum extents, because partitioning
depends on each partition having the same size.
Example: Creating an Unstructured File
The most efficient way to access unstructured disk files is by using buffer-sized reads and writes
starting at buffer-sized boundaries.
The file created in this example is designed to store fixed-length logical records that are 512 bytes
long. Provided that your application program will always read and write in multiples of 512 (thus
maintaining alignment on buffer-sized boundaries), selecting a buffer size of 512 allows the disk
process to perform most efficiently. If you designate the primary extent size as 6250 pages and
the secondary extent size as 2500 pages, then the primary extent accommodates 25,000 of the
512-byte logical records and each secondary extent accommodates 10,000. When all 16 extents
are eventually used, the entire file accommodates 175,000 records.
Assume also that you want to identify the file by the file code 1234. You could create the file by
using the FUP commands:
> volume $volume1.subvol1
> fup
-set type u
-set code 1234
-set ext (6250,2500)
-set buffersize 512
-show
TYPE U
CODE 1234
EXT ( 6250 PAGES, 2500 PAGES )
BUFFERSIZE 512
MAXEXTENTS 16
-create datafile
CREATED - $VOLUME1.SUBVOL1.DATAFILE
You could also use the FILE_CREATE_ procedure to create the file by including the TAL code in one
of your application modules:
LITERAL name^length = 25,
pri^extent = 6250,
file^code = 1234,
sec^extent = 2500,
file^type = 0, ! file type = unstructured
buffer^size = 512;
INT error;
INT filenum;
INT namelen;
STRING .filename [0:name^length-1] :=
"$VOLUME1.SUBVOL1.DATAFILE";
namelen := name^length;
error := FILE_CREATE_ (filename:name^length,
62 Unstructured Files