Microsoft KB Archive/66317

+B2 Run-Time Switch Optimizes SORT for Huge Files

PSS ID Number: Q66317 Article last modified on 04-20-1993

4.00 MS-DOS

Summary: Use of the run-time switch +B2 changes the sort algorithm to one that is more suitable for dealing with huge data files. The result is a faster, more efficient sort. The Alternative Sorting Mechanism Switch (B2) is documented in “Microsoft COBOL 4.0: Operating Guide” on Page 6-6. Normally a sort is optimized to make use of all free memory. This works well for small sorts; however, this is not very efficient when performing a sort on a file that is many times larger than the size of free memory. This optimization requires disk space that is at least twice the size of the data; records being sorted and extensive paging to disk will occur. When the +B2 run-time switch is used, the sort algorithm is altered resulting in optimized disk usage. The only free disk space that is required is approximately equal to the size of the data you are sorting. The sort will also be faster because less paging to disk will be needed.

Additional reference words: 4.00 Copyright Microsoft Corporation 1993.