Stat Extended (65)
The Stat Extended operation (B_EXTENDED_STAT) has several subfunctions that allow an application to gather information about an open file.
Parameters
 
Prerequisites
The file must be open.
Procedure
1
2
3
4
5
Subfunction 1: Extended File Information
For the file specified by the input Position Block, this subfunction returns information about the extension files associated with the specified data file. Returned information includes number of extension files that exist, number returned by the function, and file names for the returned files.
Input Data Buffer Structure
To receive information about extension files, you must create an extended files descriptor in the Data Buffer, as follows.
Output Data Buffer Structure
For the extended files subfunction, the transactional interface updates the value of the Data Buffer Length parameter and returns an extended files structure in the Data Buffer, as illustrated in Table 31.
n
Subfunction 2: System Data Information
For the file specified by the input Position Block, this subfunction returns information about whether there is a system key defined on a file, and whether the file can be logged (transaction durable).
Input Data Buffer Structure
To receive information about a file’s use of system data, you must create a system data descriptor in the Data Buffer, as follows.
Output Data Buffer Structure
For the system data subfunction, the transactional interface returns a system data structure in the Data Buffer, as follows.
Subfunction 3: Duplicate Record Conflict Information
For the file specified by the input Position Block, this subfunction returns information about the extension files associated with the specified data file. Returned information includes the record address and key number that caused a Status Code 5 (Duplicate Key) on a previous failed insert or update operation.
Input Data Buffer Structure
To receive information about the record address and key number that caused the most recent Status Code 5 (Duplicate Key), you must create a duplicate record information descriptor in the Data Buffer, as follows.
Output Data Buffer Structure
For the system data subfunction, the transactional interface returns a system data structure in the Data Buffer, as follows.
Subfunction 4: File Information
For the file specified by the input Position Block, this subfunction returns information about the extension files associated with the specified data file. Returned information includes: the internal file ID used by the transactional interface to identify the file, the number of file handles currently open, the timestamp of the last time the file was opened, and a variety of flags indicating file properties.
Input Data Buffer Structure
To receive information about an open file, you must create a file information descriptor in the Data Buffer, as follows.
Additional bytes needed for returned information. See Output Data Buffer Structure. For the file information subfunction, the transactional interface returns a file information structure in the Data Buffer.
Output Data Buffer Structure
For the file information subfunction, the transactional interface returns a file information structure in the Data Buffer, as follows.
The permitted values for the Flags field are described in the tables below.
Subfunction 5: Gateway Information
For the file specified by the input Position Block, this subfunction returns information about the Gateway engine that has control of the file.
Input Data Buffer Structure
To receive information about the Gateway engine that is responsible for the specified file, you must create a gateway information descriptor in the Data Buffer, as follows.
Output Data Buffer Structure
For the gateway information subfunction, the transactional interface modifies the Data Buffer Length parameter and returns a file information structure in the Data Buffer, as follows.
Subfunction 6: Lock Owner Identification
For the file specified by the input Position Block, this subfunction returns information about the cause of the most recent Status Code 84 or 85 that occurred when accessing the file.
Input Data Buffer Structure
To receive information about the cause of a Status Code 84 or 85, you must create a lock owner information descriptor in the Data Buffer, as follows.
Output Data Buffer Structure
For the lock owner information subfunction, the transactional interface modifies the Data Buffer Length parameter and returns a file information structure in the Data Buffer, as follows.
If there is no record in the transactional interface of a previous blocking client, then the output data buffer length is set to zero.
The permitted values for the Flags field are described in the table below.
Table 43
Subfunction 7: Security Information
This subfunction returns information about how the client was Authenticated and Authorized to access the current file. It also shows information about the Current Database being used for Security.
Input Data Buffer Structure
To receive Security information about how this handle is Authenticated what permissions it has, you must create a security information descriptor in the Data Buffer, as follows.
Output Data Buffer Structure
For the security information subfunction, the MicroKernel modifies the Data Buffer Length parameter and returns a file information structure in the Data Buffer, as follows.
The permitted values for the two Flags fields are described in the tables below.
Table 46
Table 47
Result
If the Stat Extended operation is unsuccessful, the transactional interface returns one of the following status codes: