Enscribe Programmer's Guide
Operations on Files
Common file operations include creating files, describing record formats, loading files, and
manipulating records.Table 2 (page 23) summarizes the record management functions that are
most commonly used with Enscribe files.
Creating Files
You create disk files either by calling the FILE_CREATE_ system procedure or by issuing FUP
commands:
• Programmatic creation of disk files is accomplished by supplying the appropriate parameters
to the FILE_CREATE_ or FILE_CREATELIST_ procedure.
• The FUP commands SET, RESET, and SHOW let you specify, display, and modify creation
parameters (such as file type, record length, key description, and so forth) before actually
creating a file. If you like, you can set the creation parameters to be like those of an existing
file. The FUP CREATE command then creates a file with the currently set parameters. The ALTER
command lets you change some of those parameters after the file is created. FUP accepts
commands from an online terminal or from a command (OBEY) or IN file.
Loading Files
You can use FUP to load data into existing Enscribe files. You specify the set of records to be
loaded and the file's data block and index block loading factor. The loading factor determines
how much free space to leave within a block. FUP attempts to optimize access to a file by placing
the lowest level index blocks on the same physical cylinder as their associated data blocks, thus
reducing the amount of head repositioning.
Manipulating Records
You can manipulate records in an Enscribe file by calling file-system procedures. Record
management functions and the associated system procedures are summarized in Table 2 (page 23)
Table 2 Record Management Functions Summary
ProceduresDescriptionFunction
FILE_WRITEUPDATE64_,
WRITEUPDATE
Deletes the record in a key-sequenced, queue, or relative
file as indicated by a primary-key value.
Delete
FILE_SETPOSITION_,
FILE_SETKEY_, KEYPOSITION,
POSITION
Sets the current position, access path, and positioning mode
for a file. This can indicate the start of a subset of records
in anticipation of reading the set sequentially, or it can
specify a record for subsequent updating.
Find
FILE_WRITE64_, WRITEInserts a new record into a file according to its primary-key
value.
Insert
FILE_LOCKFILE64_,
FILE_LOCKREC64_,
Locks the whole file, just the current record, or a set of
records containing the same generic key.
Lock
FILE_READLOCK64_,
FILE_READUPDATELOCK64_,
LOCKREC, LOCKFILE, READLOCK,
READUPDATELOCK
FILE_READ64_, READReads a subset of records sequentially.Read
FILE_UNLOCKFILE64_,
FILE_UNLOCKREC64_,
Unlocks the whole file, the current record in a file, or all the
records in a file.
Unlock
FILE_WRITEUPDATEUNLOCK64_,
Operations on Files 23