Patent GB-1180226-A (GB)
Title: Improvements in or relating to Data Sorting Systems
Inventor: BUHAGIAR JAN MICHAEL EDWIN PAU
IPC: G06F7/24
Filed: 1966-07-30
Abstract: 1,180,226. Sorting digital data. INTERNATIONAL COMPUTERS Ltd. 18 July, 1967 [30 July, 1966], No. 34344/66. Heading G4M. Data records on a first magnetic tape are sorted into sequence by a process which involves repetitive passes of the tape, in the first of which, a store of limited capacity is filled with the records having the lowest sort keys, and in subsequent passes the store is filled with records having the next lowest sort keys, the records in the store being sorted into sequence and recorded on a second tape between passes of the first tape. Alternatively the sorted records may be recorded on a different area of the first tape. The procedure is illustrated in Fig. 2. A register A is first set to zero and successive records are entered in the store, e.g. a core matrix, until it is full, whereupon a switch S is set. Subsequent records are only entered in the store if they have a sort key which is lower than the highest sort key in the store, and replace the latter. When the end of the file is reached, the first tape is rewound while the records in the store are sorted into sequence by a procedure detailed below. The highest sort key in the store is entered in register A ready for the next pass of the first tape. When the last records have been sorted, the store will almost certainly not have been filled and switch S will not have been set, and this condition is detected to initiate rewinding of tape 2. Two counters C1 and C2 are provided when there may be more than one record with the same sort key. After the first pass, C2 is set to the number K of records in the store having the highest sort key, and this number is transferred to C1 for the next pass. During this pass, C1 is decremented by 1 each time a sort key is detected which is the same as the highest on the first pass, so that the records having this sort key which were entered in the store during the first pass are not entered in the second pass. Should the store be filled subsequently with records having this same sort key, C1 is set to C2 + K for the third pass, thus excluding previously entered records, as before. Organization of store.-(1) Records are stored in locations such that a record at the mth location has a sort key which is greater than those of the records at the 2mth and (2m + 1)th locations. A subroutine, Fig. 3b (not shown), ensures this arrangement of records entered while the store is being filled, and the record with the highest sort key in the store is always at location 1. Another subroutine, Fig. 3c (not shown), is used when entering records after the store has been filled, shifting of a newlyentered record taking place until it occupies the appropriate position and the record with the new highest sort key being shifted to location 1. (2) An alternative store organization is described in which records are entered in successive locations, and a register B holds the highest sort key and its location in the store. When the store is filled, a new record replaces that identified by register B when it has a lower sort key, and a series of comparisons are then made to determine and locate the new highest sort key. Sorting of stored groups.-The number P = the number of records in the group stored and equals the capacity of the store except after the final pass of tape 1. The records in locations 1 (highest) and P are inter-changed and P is reduced by 1. The subroutine, Fig. 4 (not shown), is branched out to end the operation when P is or has been reduced to 1. The interval shifting subroutine, Fig. 3c, is then utilized to shift the record now in location 1 to the appropriate location in the store organization (1) but excluding the location occupied by the highest sort key(s).