The BSRTSUM structure is a structure to define the summation field when the record summation option is used.
When the values of the specified key fields are equal, add the summation fields to make 1 record. In the case of text files, only the numbers described in ASCII code and Unicode are to be processed. This option is effective in the sort option and the merge option. The record summation option has an exclusive relationship with the suppression option. When specified at the same time as the first-in first-out (FIFO) option, the specification of the first-in first-out (FIFO) option is disregarded.
The size of the area when the area of BSRTSUM structure is secured can be calculated by using BS_SUMTABSIZE(n). BS_SUMTABSIZE(n) is a macro to calculate the size of n pieces of BSRTSUM structures.
Information
If an overflow occurs during record summation, short records (excluding the summation field) are input, or an invalid code is found in the summation field during text record summation, the return value of the bsrtopen function is zero, and BSERR_OVERFLOW, BSERR_SUMSHRTREC, or BSERR_SUMFIELD is set in the errdetail of the BSRTREC structure.
typedef struct { unsigned long entry_no; BSSUM sum_entry[1]; } BSRTSUM;
BSRTSUM structure member
In the following, it explains about the member of the BSRTSUM structure.
entry_no
This specifies the number of the summation field (BSSUM structure).
When 0 is specified, this means that the summation field is omitted.
sum_entry[n]
This specifies the summation field.
For more information, refer to BSSUM structure.