SORT-MERGE/XL Programmer's Guide (32650-90884)
30 Chapter2
Creating Core Routines That Sort and Merge
Initializing a Sort or Merge
Note that the HPMERGEINIT intrinsic call is different from the HPSORTINIT intrinsic call.
var
status : INTEGER;
inputfiles : array [1..3] of INTEGER;
outputfile : array [1..2] of INTEGER;
keysonly : INTEGER;
numKeys : INTEGER;
keys : array [1..4] of INTEGER;
altseq : array [1..2] of CHAR;
inputfiles[1] := tempFileNum; {from HPFOPEN}
inputfiles[2] := permFileNum: {from HPFOPEN}
inputfiles[3] := 0;
outputfile[1] := outFileNum; {from HPFOPEN}
outputfile[2] := 0;
keysonly := 0; {output record format same as }
{input record format }
numKeys := 1; {one key}
keys[1] := 41; {key begins}
keys[2] := 20; {key length}
keys[3] := 0; {byte data}
keys[4] := 0; {ascending order}
altseq[1] := CHR(255); {data = ASCII }
{sequence = ASCII }
altseq[2] := CHR(255); {256 characters in ASCII}
HPMERGEINIT (status, inputfiles, outputfile,
keysonly,,, numkeys, keys, altseq,,,,,);