You mentioned DOS, so presumably you are happy with command lines. If I understand you correctly, and the file format is exactly as described, you could try concatenating your files, e.g.
copy file1.txt+file2.txt bigfile.txt
(or use a "cat" program) and sort the result with any sort program. Or, in one pass and very fast, try RPSORT, available from DOS legacy sites e.g. the Free Software for DOS Web site. Their sort utilities page is
http://home.att.net/...ft/txtutil2.htm#sortFrom RPSORT's help:
Usage: RPSORT [/Q] [/Eerrfile] [/]? [inputfile[+inputfile]] [outputfile] [/A]
[/B] [/C] [/D] [/Fnnnn] [/N] [/P] [/R] [/td][/tr][/table] [/Z] [sort key defin...]
Sort key defin syntax: /+ [col] [:len] [A] [C] [F] [I] [M] [P] [R] [T] [U]
-------------------------------------------------------------------------------
Parameters may be entered in any order except as noted below.
RPSORT may be run as a filter using redirection.
For example: RPSORT <ipfile >opfile
or: DIR | RPSORT | MORE
Input and output may be specified directly. Input is one or more
filespecs separated by plus signs. Output must be a single file.
Input filespec(s) must precede output filespec. Filespecs may
include a path. Wildcard characters are allowed. Input files are
sorted together into the single output file.
For example: RPSORT ipfile*.txt+c:\mydir\ip??file.txt opfile
By default, RPSORT assumes the input is a text file and that the
entire line is the sort key. The sort is case insensitive (lower
equals upper case) and just like the DOS SORT it equates foreign
letters, punctuation, and currency symbols to their English
equivalents. The following screens describe other options.