You end the sorting or merging process with HPSORTEND or HPMERGEEND.
The syntax for HPSORTEND and HPMERGEEND is:
HPSORTEND (status, statistics); HPMERGEEND (status, statistics);
The part of the core routine example at the end of the chapter that uses the HPSORTEND intrinsic follows.