SORT-MERGE/XL Programmer's Guide (32650-90884)

34 Chapter2
Creating Core Routines That Sort and Merge
Example of Core Sorting Routine
Example of Core Sorting Routine
The following program sorts the personnel files shown below. They are sorted together by
last name. The record size is determined by the input files. The
status
parameter is
checked after the calls to HPSORTINIT and HPSORTEND.
The files that are used in this example are as follows (character positions and data
descriptions are indicated for convenience only):
TEMPEMP Information file about temporary employees:
Last Name First Name Employee Number Hire Date
Gangley, Tomas 000003 06/06/87
Rields, Evelyn 000007 07/12/87
Everett, Joyce 000029 10/19/87
0 1 2 3 4 5 6 7
1234567890123456789012345678901234567890123456789012345678901234567890
PERMEMP Information file about permanent employees:
Last Name First Name Employee Number Hire Date
Jones, Eliza 000001 06/06/87
Smith, James 000005 06/06/87
Jackson, Johnathon 000006 06/06/87
Washington, Lois 000014 07/23/87
Jackson, Rosa 000022 08/15/87
0 1 2 3 4 5 6 7
1234567890123456789012345678901234567890123456789012345678901234567890