SORT-MERGE/XL Programmer's Guide (32650-90884)
Chapter 2 25
Creating Core Routines That Sort and Merge
Initializing a Sort or Merge
This is the output format:
3 Each output record contains the logical record number (in binary format)
followed by the key fields.
The output format appears the same as for option 2, but the logical record
number is stored in the first two bytes of the record. To view the logical
record number, use the FCOPY utility or the ASCII intrinsic, as in
outputoption
= 1.
Output Record Format (MERGE/XL)
You specify the format of the MERGE/XL output file with the
keysonly
parameter of
HPMERGEINIT.
The part of the core routine example at the end of the chapter that specifys the
keysonly
in HPSORTINIT is:
The options are
keysonly
equals:
0 Output record format is the same as the input record format (default).
1 Each output record contains only the key fields. The primary key is the
leftmost; each succeeding key is to the right.
The following example shows the record format for input and output
records if the primary key is last name and the secondary key is employee
number (
keysonly
=1). This is the input format:
This is the output format:
Specifying Keys
The key indicates the part of each record that is compared to determine output record
order. In HPSORTINIT or HPMERGEINIT, you indicate the number of keys with the
numkeys
Jones, 000001
var
keysonly : INTEGER;
.
.
.
keysonly := 0; {output record format same as}
{input record format}
Jones, Eliza 000001 06/06/87
Jones, 000001