Enscribe Programmer's Guide
UNLOCKFILE, READLOCK, LOCKREC, and UNLOCKREC.Enscribe entry-sequenced files are not
designed for random access. If the data records contain unique alternate-key values, however,
you can use KEYPOSITION in conjunction with FILE_READ64_, FILE_READLOCK64_, READ or
READLOCK to access them randomly.
NOTE: If an error occurs during an attempt to insert a record into an alternate-key file, 0-length
records might occur in the primary entry-sequenced file. This can also occur when a transaction
aborts that inserted records into an audited entry-sequenced file. The 0-length records are substituted
for the inserted records during TMF BACKOUT.
Figure 19 Entry-Sequenced File Structure
10th
Record
11th
Record
12th
Record
13th
Record
14th
Record
Data ataDataD DataData Unused
Data
Blocks
Data ataDataD Data
1st
Record
2nd
Record
3rd
Record
4th
Record
Unused
Data ataDataD DataData
5th
Record
6th
Record
7th
Record
8th
Record
9th
Record
Unused
Variable-Length
Physical Records
Creating Entry-Sequenced Files
You create Enscribe entry-sequenced files by using either the File Utility Program (FUP) or by calling
either the FILE_CREATE_ or the FILE_CREATLIST_ system procedures. If you wish to explicitly create
key-sequenced format 2 file, use the procedure call FILE_CREATELIST_ with item code 195.
When you create a partitioned (multivolume) file, the file system automatically creates all of the
partitions of that file when the first partition is created.
If you use a system procedure to create an entry-sequenced file and the file contains alternate-key
fields, then you must also create one or more alternate-key files. If you are using FUP to create the
primary-key file, however, FUP automatically creates any required alternate-key files.
When creating an entry-sequenced file, you must consider the maximum logical record size, the
data block length, and disk extent sizes.
NOTE: Since the primary keys of entry-sequenced files are larger in format 2 files, the size of
alternate key records will also be larger. This may affect code that creates alternate-key files and
programs that directly read the contents of alternate-key files may be affected
Logical Records
A record is the unit of information transferred between an application program and the file system.
When creating an entry-sequenced file, you must specify the maximum logical record size of that
file. The particular maximum record size that you choose when creating a file depends upon the
particular requirements of your application.
124 Entry-Sequenced Files