Enscribe Programmer's Guide

value^list.block^length := 4096;
value^list.pri^extent := 1000;
value^list.sec^extent := 500;
value^list.partitions := 3;
value^list.part^info[0].part^pri^extent := 1000;
value^list.part^info[0].part^sec^extent := 500;
value^list.part^info[1].part^pri^extent := 1000;
value^list.part^info[1].part^sec^extent := 500;
value^list.part^info[2].part^pri^extent := 1000;
value^list.part^info[2].part^sec^extent := 500;
value^list.vol^name^len.vol^name^act^len[0] := 7;
value^list.vol^name^len.vol^name^act^len[1] := 7;
value^list.vol^name^len.vol^name^act^len[2] := 7;
value^list.vol^names ':=' "$STORE2$STORE3$STORE4";
ERROR := FILE_CREATELIST_ (filename:name^length,namelen,
item^list, item^list^len, value^list,
$LEN(value^list), error2);
END;
Accessing Entry-Sequenced Files
You can perform three basic operations with an entry-sequenced file:
Add (FILE_WRITE64_/WRITE) records to the end of the file.
Read (FILE_READ64_, FILE_READLOCK64_, READ or READLOCK) records sequentially
according to either their primary keys or a specified alternate-key value.
Specify the desired alternate-key access path (FILE_SETKEY_ or KEYPOSITION).
In addition, you can use FILE_GETINFOLIST_ to obtain the address of the record just read or written,
and you can use FILE_SETKEY_ or KEYPOSITION in conjunction with unique alternate-key values
to read individual records in a random manner.
Sequential Access
Enscribe entry-sequenced files are designed for sequential access. You always append new data
records to the end of the file using the FILE_WRITE64_/WRITE system procedure
When reading an entry-sequenced file, you generally do so in a sequential manner either by
primary key (all records in the file) or by a particular alternate-key value (all records in the file that
contain that value in the designated field).
When you open the file, the access path is by primary key. You use the FILE_SETKEY_ or
KEYPOSITION system procedure to change the access path from the primary key to a particular
alternate key and from one alternate key to another. After reading data records by a particular
alternate key, you can reset the access path back to the primary key (starting at the beginning of
the file) by using FILE_SETKEY_ or KEYPOSITION with both a key specifier and a key value of 0.
If the data records are of variable lengths, you specify the maximum record length as the read-count
parameter in the FILE_READ64_, FILE_READLOCK64_, READ or READLOCK procedure call. The
file system recognizes the end of the physical record on the disk and returns the actual data record
length, in bytes, as the count-read parameter.
Random Access
If every data record in an entry-sequenced file contains a unique alternate-key value in a particular
field, you can use FILE_SETKEY_ or KEYPOSITION in conjunction with FILE_READ64_,
FILE_READLOCK64_, READ or READLOCK to read individual data records in a random manner.
For example, if the file contains transaction summary records and one of the fields in each data
record contains a unique transaction number, you could use that field as an alternate key to locate
any desired transaction record.
Accessing Entry-Sequenced Files 131