A method of externally sorting large files in a computer system is
presented. The contents of the input file to be sorted are investigated
in order to identify presorted portions thereof. The presorted portions
of the input file as thus identified are incorporated as sorted strings
into an external sortwork file, by rearranging directory information
rather than physically transferring data. If merging is necessary, the
data may then be merged by a procedure wherein blocks of sorted data to
be merged are incorporated into an output (sortout) file, by rearranging
directory information rather than physically transferring sorted blocks
to the sortout file. As a result of the process, portions of sorted data
incorporated into the sortout file may physically remain in external
storage space allocated to the input file, and/or in external space
allocated to sortwork, thereby eliminating or reducing reading and
writing from disk during sort-merge processing.