Enscribe Programmer's Guide
12 File Loading
File Utility Program (FUP) Commands
The File Utility Program (FUP) commands that you use to load data into an existing file are LOAD
and LOADALTFILE.
The LOAD command loads data into an existing structured disk file without affecting any related
alternate-key files. Any previous data in the file being loaded is lost. When loading data into
key-sequenced files, the input records can be in either sorted or unsorted order; unless you specify
the SORTED option, unsorted is assumed. For key-sequenced files, you can also specify slack space
(a percentage of data block and index block space) to be left for future insertions.
The LOADALTFILE command generates alternate-key records from a specified primary-key file, sorts
the generated records into ascending order by alternate-key value, and then loads the sorted
records into a specified alternate-key file. You can specify slack space for future insertions. If your
system does not have enough disk space available to perform the sorting operation in conjunction
with the file loading operation, you can do the two operations separately. To do this, you would
first use a FUP BUILDKEYRECORDS command to do the sorting; the sorted output can, for example,
be directed to a magnetic tape. You would then use a FUP COPY or LOAD command to load the
sorted records from the intermediate file into the destination alternate-key file.
The examples in this section illustrate file loading operations that require a sequence of FUP
commands.
For more information about FUP, refer to the File Utility Program (FUP) Reference Manual.
Loading a Key-Sequenced File
For this example, file $VOL1.SVOL.PARTFILE is a key-sequenced file having three partitions. The
first secondary partition is $VOL2 and the second secondary partition is $VOL3.
Any record having a primary-key value in the range of zero up to but not including HA are to exist
in the primary partition; records with primary-key values from HA up to but not including RA are
to exist on $VOL2; records with primary-key values of RA or greater are to exist on $VOL3.
The records to be loaded into this file are 128 bytes long and are on tape in unsorted order, with
one record per block.
The FUP commands to perform this operation are:
-VOLUME $vol1.svol
-LOAD $TAPE, partfile
LOAD reads the records from tape drive $TAPE and sends them to the SORT process. When all
records have been read, sorting begins. When the sort is finished, the records are read from the
SORT process and loaded into the file according to the file's partial-key-value specifications.
The data and index block slack percentage is zero.
Defining a New Alternate Key
This example defines a new alternate-key field for the primary file $VOL1.SVOL.PRIFILE, whose
existing alternate-key file is $VOL1.SVOL.ALTFILE. The alternate-key records for the new key field
will be added to file ALTFILE.
The key specifier for the new key is NM, the key offset in the record is 4, the key length is 20, and
a null value of “ ” (blank) is specified for the new key field.
The FUP commands to perform this operation are:
-VOLUME $vol1.svol
-ALTER prifile, ALTKEY ( "NM", KEYOFF 4, KEYLEN 20, NULL " ")
-LOADALTFILE 0, prifile, ISLACK 10
File Utility Program (FUP) Commands 161