The BSRTFILE structure specifies information in input file, output file, message file and temporary file.
When all file information to be specified in BSRTFILE structure is omitted, NULL is specified for the parameter file of the bsrtopen function. To specify file information, execute it after securing an area.
typedef struct { BSPTR_BSFILE inpfile_tbl; BSPTR_UCHAR outfile_addr; BSPTR_BSFILE tmpfile_tbl; BSPTR_UCHAR msgfile_addr; BSPTR_BSFSYS inpfsys_tbl; unsigned char outfsys; unsigned char recovery; unsigned char reserve[2]; /* reserved */ BSPTR_BSIDX idx_addr; BSPTR_BSFILE_EXT outfile_tbl; BSPTR_VOID reserve2; /* reserved */ } BSRTFILE;
BSRTFILE structure member
In the following, it explains about the member of the BSRTFILE structure.
inpfile_tbl
To specify input file path name, set address of the BSFILE structure to which input file path name is set.
To input from the standard input or hand over the record from user application (bsrtput function or bsrtmrge function), set NULL.
outfile_addr
To specify output file path name, set the address of the file path name.
The file path name is a character string that ends with '\0'. To specify two or more output files, set them in outfile_tbl of BSRTFILE structure. To output to the standard output or return the record to user application (bsrtget function or bsrtmrge function) or specify two or more output files, set NULL.
tmpfile_tbl
To specify temporary file path name, set the address of BSFILE structure to which temporary file path name is set.
When temporary file path name is omitted, set NULL. In this case, PowerBSORT decides the folder that makes the temporary file according to the following priority levels. When the specified folder doesn't exist, it becomes an error.
Folder specified by environment variable BSORT_TMPDIR
Folder specified by environment variable TEMP
Folder specified by environment variable TMP
Folder of Windows system
msgfile_addr
To specify message file path name, set the address of the file path name.
The file path name is a character string that ends with '\0'. When message file path name is omitted, set NULL. In this case, the message is output to the specified file if environment variable BSORT_MSGFILE is specified.
inpfsys_tbl
This sets address of BSFSYS structure.
When the input file path name is not specified or when only the standard file system of the system is used, specification can be omitted.
outfsys
This sets file system of output file.
For information about the file system, refer to BSFSYS structure. When the output file path name is not specified or when the standard file system of the system is used, specification can be omitted.
recovery
This sets recovery processing when the output file abnormally terminates.
The recovery processing is effective in the case data mass that abnormally terminates when the output file is a standard file system of the system is processed. When the recovery processing is set, two or more output files are specified. The output processing ends without opening another output file if the output file abnormally terminates when this specification does not exist.
When the recovery processing is specified, specify the following.
Define value | Meaning |
---|---|
BSRC_FILE | Recovery processing is executed. |
idx_addr
This sets address of BSIDX structure.
It is effective for COBOL file system. It cannot be omitted for the indexed file of COBOL file system.
outfile_tbl
This sets address of BSFILE_EXT structure.
The BSFILE_EXT structure is specified in the following cases.
Specification of output file information when recovery processing is done
Specification of owner name of input Btrieve file or index information on output Btrieve file when Btrieve file system is specified for file system of input file or output file