Enscribe Programmer's Guide

If you designate the primary extent size as 5000 pages and the secondary extent size as 2000
pages, then the primary extent will accommodate 65,000 credit records and each secondary
extent will accommodate 26,000 additional credit records. When all 16 extents are eventually
used, the file will accommodate a total of 455,000 credit records.
The primary-key length is 34 bytes.
Assume also that you want to identify the file by the file code 1000 and that you want to enable
key compression for both data and index blocks. You could create the file by using these FUP
commands:
> volume $store1.svol1
> fup
-set type k
-set code 1000
-set ext (5000,2000)
-set rec 150
-set block 2048
-set compress
-set keylen 34
-show
TYPE K
CODE 1000
EXT ( 5000 PAGES, 2000 PAGES )
REC 150
BLOCK 2048
IBLOCK 2048
KEYLEN 34
KEYOFF 0
DCOMPRESS, ICOMPRESS
-create myfile
CREATED - $STORE1.SVOL1.MYFILE
Using the FILE_CREATE_ system procedure, you could create the file by including this TAL code in
one of your application modules.
In this code, the volume name and node name are not specified. FILE_CREATE_ obtains them from
the current value of the VOLUME attribute of the =_DEFAULTS DEFINE. For more information on
the =_DEFAULTS DEFINE, see the TACL Programming Guide.
LITERAL name^length = 12,
pri^extent = 5000,
file^code = 1000,
sec^extent = 2000,
file^type = 3,
options = %30, !data compression
rec^len = 150,
data^block^len = 2048,
key^len = 34,
key^offset = 0;
INT error;
INT namelen;
STRING .filename [0:name^length-1] :=
"SVOL1.MYFILE";
namelen := name^length;
error := FILE_CREATE_ (filename:name^length, namelen,
file^code, pri^extent, sec^extent,, file^type,
options, rec^len, data^block^len, key^len,
key^offset);
IF Error <> 0 THEN ... ! error
Example 2: Creating a Key-Sequenced File With Alternate Keys
This example shows how to create a key-sequenced inventory control file in which the primary key
is the part number and both the storage location code and vendor number are alternate keys.
Creating Key-Sequenced Files 77