In PowerBSORT, there are processing options that can be used by combining with the main functions.
The record selection option applies selection criteria to input records to determine their eligibility during sort, merge or copy operations. If the record selection is not used then all input records are selected for processing. The record selection option can be used with the sort, merge or copy functions.
Record selection is accomplished by specifying selection criteria. The criteria can compare fields in a record to other fields in the record, or to literal values. Records that fully match the criteria are selected for processing.
Example
The following example shows the result of selecting records where the compared field is greater than the comparing field. The order of the sorted records is determined by the key field.
The record reconstruction option allows input records to be rearranged. The order of the fields in a record can be changed by this option, and literal values can be inserted a new fields. It is used with the sort, merge and copy functions.
When the reconstruction option is used, output records are built according to the list of fields you specify. Newly constructed records may have one or more of the fields from the input record, and literal values inserted as needed. Output records are always constructed in the order specified by the reconstruction option.
Example
The following example shows the result of reconstructing records. The output record contains only the three fields selected from the input record; sorted by the key field.
The record summation option is used to summarize records having similar key fields, storing the sum of the summation fields in the output record. The summation option can be used with the sort or merge function only. The summation option cannot be used in combination with the copy function and the suppression option. The FIFO (first-in, first-out) option is disregarded when combined with the FIFO (first-in, first-out) option.
With this option, similarly keyed records are consolidated to a single output record. The specified summation fields in the output record are the accumulated values of the input records.
Example
The following example shows that the result of a record summation. The output records are consolidated to two records, one for each unique key from the input file. The summation field contains the sum of the input records.
The suppression option is used to filter records that are similarly keyed such that the output file contains only one record per key. This option can be used with the sort or merge function only. The suppression option cannot be used in combination with the copy function and the summation option. The FIFO (first-in, first-out) option is disregarded when combined with the FIFO (first-in, first-out) option.
When this option is used, similarly keyed records from the input file are ignored and not written to the output file.
Example
The following example shows that the result of using the suppression option. The first instance of the key 1 and key 2 is written to the output file. The additional instances of key 1 are ignored.
FIFO (first-in, first-out) option
The FIFO (first-in, first-out) option is used to ensure that similarly keyed records appear in the output file in the same sequence as they occur in the input file. The FIFO option can be used with the sort function. The FIFO (first-in, first-out) option is disregarded when combined with the merge function, the copy function, the record summation option, and the suppression option.
Use the FIFO options when the sequence of the records in output file of similarly keyed records must be maintained.
Example
The following example shows the result of using the FIFO option. The relative sequence of the key 1 records is maintained in the output file.
Note
When the FIFO (first-in, first-out) option is not used by the sort function, the order of outputting the record with the key field of equivalence is irregular.