Enscribe Programmer's Guide

Example 1: Creating a Relative File
This example shows how to create an employee data file in which the individual records are to
be accessed by employee number. If the employee numbering scheme starts at zero or one (for
the first employee) and proceeds sequentially upward in increments of one, it is reasonable to use
a relative file.
name
home-address emp-# dept-code job-code
salary hire-date termination-date
90 100 106 112
Byte offset:
580857040
Note that while the employee number also happens to be included as data within the record, the
records are actually accessed by their relative record number.
Assuming a format 1 file, with a record size of 112, selecting a block size of 4096 results in a
blocking factor of 35 records per block:
N = (B - 22) / (R + 2)
35 = (4096 - 22) / (112 + 2)
If you designate the primary extent size as 60 pages and the secondary extent size as 30 pages,
then the primary extent will accommodate 1050 employee records and each secondary extent
will accommodate 525 additional employee records. When all 16 extents are eventually used,
the file will accommodate a total of 8925 employee records.
You could create the file by using these FUP commands:
>volume $store1.svol1
>fup
-set type r
-set ext (60,30)
-set rec 112
-set block 4096
-show
TYPE R
138 Relative Files