SORT-MERGE/XL Programmer's Guide (32650-90884)
Chapter 2 23
Creating Core Routines That Sort and Merge
Initializing a Sort or Merge
HPSORTINIT or HPMERGEINIT intrinsics.
Now that you have the file numbers, you can initialize the
inputfiles
parameter:
If you do not specify anything in
outputfile
SORT-MERGE/XL assumes that output will
be by individual record and that you are using the HPSORTOUTPUT intrinsic.
Output Record Format (SORT/XL)
You specify the content of the SORT/XL output file with the
outputoption
parameter of
HPSORTINIT. The part of the core routine example at the end of the chapter that specifys
the
outputoption
in HPSORTINIT is:
const
designator = 2; {HPFOPEN formaldesignator= option}
domain = 3; {HPFOPEN file domain= option}
access = 11; {HPFOPEN access type option #3}
record_size= 19; {HPFOPEN record length option #3}
var
outFileNum : INTEGER;
status : INTEGER;
outFile : packed array [1..10] of CHAR;
new : INTEGER;
write : INTEGER;
size : INTEGER;
new := 4; {creates a permanent file}
write := 1; {file is write-only access}
size := 80;
outFile := '%ALLEMP%';
HPFOPEN (outFileNum, status, designator, outFile,
domain, new, access, write, record_size, size);
var
outputfile : array [1..2] of INTEGER;
.
.
.
outputfile[1] := outFileNum; {from HPFOPEN}
outputfile[2] := 0;
var
OutputOption : INTEGER;
.
.
.
OutputOption := 0; {Output record format same}
{ as input record format }