Top
PowerBSORT V7.0 User's Guide
FUJITSU Software

7.4.3 bsrtput function

When the sort option is specified in the bsrtopen function and records are passed from user applications to PowerBSORT, the bsrtput function is used.

Format

#include "bsrt.h"
BSRTFUNC func; (Note)
int func.bsrtput(BSPTR_BSRTREC rec);

NOTE

func is a parameter specified in thebsrtopen function.

Function explanation

The function of the bsrtput function is shown below.

How to pass record group

When two or more records are passed to PowerBSORT at once, specify the length of the record group in rec_len of BSRTREC structure.
The length of the record group is in multiple of the number of records of record length in the fixed-length record format. In the variable-length record format, area of the record length (long type of C language) is prefaced for each record. The length of record group is accumulated length of the record and record length area. The record length does not include the area of the record length. In text file, the record that includes line feed character is stored in a continuous area. The length of the record group is the length from the head of the record to the line feed character of the last record.

Parameter detail

In the following, it explains the parameter of the bsrtput function.

rec

This specifies rec specified in bsrtopen function.

Information

BSPTR_BSRTREC is a pointer of BSRTREC structure.

Return value

The return values of the bsrtput function are as follows.

Return value

Meaning

0

This shows that the bsrtput function ended normally.

1

This shows that the end of the record or record group was normally accepted.

-1

This shows that an error occurred in the bsrtput function.
Detailed information is set in errdetail or sub_error_code of BSRTREC structure.